NOTICE: Our Community is moving. Get more information. Updated information on a New Login Process
Why would one get "Error: Incorrect number of arguments to function SetText" in SilkTest 6 sp2 when using the Browser.location.SetText(sUrl) method?
QUESTION ----------------------------------
Why do I get "Error: Incorrect number of arguments to function SetText" in SilkTest 6 sp2 when using the Browser.location.SetText(sUrl) method?
ANSWER ----------------------------------
The reason for this error is a known problem with SilkTest 6.0.2.0 [10sp2].
There are two possible workarounds.
1. Use "Browser.Navigate(sUrl)" instead of "Browser.location.SetText(sUrl)" in your scripts. Browser.Navigate() just calls SetText() and TypeKeys("") and will work better for cross-browser testing. Also will save having to carry out step two multiple times for different machines.
2. Modify the Browser.inc file. Line 324 in the Browser.inc that ships with SilkTest 6.0.2.0 [10sp2] reads:
Browser.GetRealBrowser ().Location.SetText ()
But it should read:
Browser.GetRealBrowser ().Location.SetText (sText)