By default, Silk Test Classic issues API-based clicks rather than Agent-based clicks to improve the reliability of recorded and scripted clicks in HTML applications. An API click is generated internally by the browser, instead of by the Silk Test Classic Agent. API clicks are more reliable than Agent clicks which can click the wrong location of an object.
Use the DoClick method instead of Click in cases in which the Click method cannot successfully click. In some cases, the Click method may not be able to find the location of these items; use DoClick in such situations.
link.Click ( [iButton, iXpos, iYpos] )
Variable | Description |
---|---|
iButton | Optional: The mouse button to press: Windows: 1 for left (default), 2 for right, and 3 for center. INTEGER. |
iXpos | Optional: The horizontal coordinate at which to click. If you specify iXpos, you must also specify iYpos. The default is the center of the object. INTEGER. |
iYpos | Optional: The vertical coordinate at which to click. The default is the center of the object. INTEGER. |
Click moves the mouse to the Html object and clicks the specified mouse button. The coordinates are relative to the object. If you do not specify coordinates, the click occurs in the center of the object.
If you are recording an application using the Mozilla Firefox browser, Silk Test Classic captures different coordinates for the Click() method if you use Record/Testcase and compare that with the results you get during Record/Actions.
When using the Mozilla Firefox browser extensions, do not use API click mode when calling the Click() method for an HtmlPushbutton that will bring up a modal dialog. The Click() method will never complete, effectively hanging the test script. Instead, use Agent click mode. You can force Agent click mode for specific calls by calling Click (1) instead of Click(). Likewise, do not call the Click() method for a XulPushButton if clicking the button brings up a modal dialog. The Click() method will never complete, effectively hanging the test script. Note that XulPushButton controls are generally pushbuttons that are part of the Mozilla Firefox browser window.