Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

Why would one get "Error: Incorrect number of arguments to function SetText" in SilkTest 6 sp2 when using the Browser.location.SetText(sUrl) method?

Why would one get "Error: Incorrect number of arguments to function SetText" in SilkTest 6 sp2 when using the Browser.location.SetText(sUrl) method?

Problem:

Why would one get "Error: Incorrect number of arguments to function SetText" in SilkTest 6 sp2 when using the Browser.location.SetText(sUrl) method?

Resolution:

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)


Old KB# 22173

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2013-02-15 19:28
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.