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

How does the DoClick( ) method differ from the standard Click() method and can SilkTest automatically record DoClick?

How does the DoClick( ) method differ from the standard Click() method and can SilkTest automatically record DoClick?

The Click() Method simulates a physical click with the mouse peripheral on an x, y co-ordinate on the window screen space. When used in connection with an object, SilkTest automatically calculates where on the screen the object is and performs the click in that location for the object, which normally triggers the action that manually clicking on the object would perform. However, this simulation is not a true recreation of the manually performed click, as it is sometimes hampered by layers which are present in the "simulation mode" when SilkTest performs the action.

The DoClick() Method, is only available under IE DOM for objects of HtmlLink, HtmlImage or HtmlPushButton class type. These classes have a built in "DoClick" function associated with them, which SilkTest hooks into to simulate the manual click, directly on the object itself, rather than a general, window screen space "click".

Regarding the possibility of having SilkTest automatically record DoClick() instead of Click(), it is possible to force SilkTest to record DoClick against HtmlLinks.

Extend the class as follows:

[-] winclass HtmlImage: HtmlImage
[-] boolean Click(INTEGER iButton optional, INTEGER x optional, INTEGER y)
[ ] print("here")
[ ] DoClick()


DoClick() information from SilkTest online help:

DoClick() method


HtmlLink class, HtmlImage, and HtmlPushButton for Internet Explorer DOM only. For Netscape 6, the DoClick() method works only for menus and controls on the Netscape Navigator 6 toolbar.


Calls the DOM Click() method on an HtmlLink, HtmlImage, or HtmlPushButton, instead of simulating a physical mouse click.


DoClick ()


Use the DoClick() method instead of Click() in cases in which the Click() method cannot successfully click an HtmlLink, HtmlImage, or HtmlPushButton. (In some cases, the Click() method may not be able to find the location of these items; use DoClick() in such situations.) Note that if an x or y coordinate of 0 is passed to the Click method, DoClick is called automatically.

DoClick() is not implemented for SilkTest International.


The following example clicks an HtmlPushButton declared as Enter.

GMO.Enter.DoClick ()

Old KB# 22481


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:31
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.