ClickButton action moves the mouse pointer to a control’s button and then simulates a single click of the left mouse button. The
Button parameter specifies the button index or caption.
TestObj.ClickButton(Button, ClientX, ClientY)
|TestObj||A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section|
|ClientX||[in]||Optional||Integer||Default value: -1|
|ClientY||[in]||Optional||Integer||Default value: -1|
The method is applied to the following object:
This method is available in the Object Browser panel and in other panels and dialogs in both Basic and Advanced view modes.
The method has the following parameters:
Specifies the control’s edit button to be clicked. You can enter the button’s index (an integer value from 0), or string that contains the button’s caption.
The caption can contain asterisk (*) or question mark (?) wildcards or regular expressions. The asterisk corresponds to a string of any length (including an empty string), the question mark corresponds to any single character (including none). To specify more complicated parts of a caption, use regular expressions.
The caption can be case-sensitive or case-insensitive depending on the value of the Use case-sensitive parameters project setting.
Specifies the horizontal coordinate of the point, to which the mouse cursor will be moved before click-simulation. Default value is -1 and it means that the mouse cursor will be moved to the center of the edit button.
Specifies the vertical coordinate of the point, to which the mouse cursor will be moved before click-simulation. Default value is -1 and it means that the mouse cursor will be moved to the center of the edit button.
The ClientX and ClientY parameters specify coordinates in the button’s client area. The origin of client coordinates is in the top left corner of the edit button. When these parameters are not specified, mouse cursor will be moved to the center of the edit button.
If the specified button is not found,
ClickButtonfails and posts an error message to the test log.
If TestObj refers to an object of a non-DPI-aware application running with a DPI setting other than 100%, set the ClientX and ClientY parameter values relative to the application (as if the application is running with the 100% DPI setting).