DoClick Method

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. See API click versus Agent click for more information.

Class

  • HtmlCheckBox
  • HtmlColumn
  • HtmlHeading
  • HtmlImage
  • HtmlLink
  • HtmlMarquee
  • HtmlPushButton
  • HtmlRadioButton
  • HtmlText
  • HtmlTextField

Action

Calls the browser’s Click() method, instead of simulating a physical mouse click.

Availability

This functionality is supported only if you are using the Classic Agent.

Syntax

DoClick ([bAsync])
Variable Description
bAsync Optional: TRUE to execute asynchronously. Default is FALSE. If clicking the control causes a modal dialog box, pop-up browser, or other pop-up window to appear, then by default DoClick hangs while the dialog box or pop-up window is open. In such situations, you should set bAsync to TRUE. This causes DoClick to return immediately, which allows your script to continue processing, that is, manipulate or close the dialog box or pop-up window. BOOLEAN.

Notes

Currently, DoClick for the DOM extension is the only available API-based click. See the description of the OPT_AGENT_CLICKS_ONLY agent option for more information.

Example

The following example clicks an HtmlPushButton declared as Enter.

GMO.Enter.DoClick ()