MouseDown Method (Desktop Objects)

Applies to TestComplete 12.60, last modified on September 17, 2018

Description

Use this method to simulate pressing a mouse button at a point with the specified screen coordinates.

Declaration

TestObj.MouseDown(VKXY)

TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section
VK [in]    Required    Integer    
X [in]    Required    Integer    
Y [in]    Required    Integer    
Result None

Applies To

The method is applied to the following object:

View Mode

To view this method in the Object Browser panel and in other panels and dialogs, activate the Advanced view mode.

Parameters

The method has the following parameters:

VK

Specifies the button to be pressed. You can use the following values for the parameter:

Constant Value Description
VK_LBUTTON 1 The left mouse button.
VK_RBUTTON 2 The right mouse button.
VK_MBUTTON 4 The middle mouse button.

If the Win32API plugin is installed in TestComplete, you can refer to the constants using their names without defining them in scripts.

X

The screen-relative horizontal coordinate of the pixel at which pressing the mouse button will be simulated.

Y

The screen-relative vertical coordinate of the pixel at which pressing the mouse button will be simulated.

Result Value

None.

Remarks

Unlike Click, ClickM, ClickR, DblClick, DblClickM and DblClickR, the MouseDown method does not interact with the tested application. This makes the method useful for testing specific ActiveX controls.

To release the mouse button, use the MouseUp method.

See Also

MouseUp Method (Desktop Objects)
Click Action
ClickR Action
ClickM Action
DblClick Action
DblClickR Action
DblClickM Action

Highlight search results