[Expand]General Information/viewarticle/63445/
 [Expand]Using Help System/viewarticle/55799/
 [Expand]Getting Started Tutorial/viewarticle/56246/
 [Expand]Using TestComplete/viewarticle/57875/
 [Expand]Testing Types/viewarticle/62721/
 [Expand]Applications Testing/viewarticle/62606/
 [Expand]Working With Application Objects and Controls/viewarticle/55815/
 [Expand]Samples and Tutorials/viewarticle/56239/
  [Expand]Test Objects/viewarticle/57881/
  [Expand]Scripting Objects/viewarticle/57882/
  [Collapse]Project and Project Item Objects/viewarticle/57880/
   [Expand]Project Suite Objects/viewarticle/59766/
   [Collapse]Project Item Objects/viewarticle/59767/
     ActiveX Objects/viewarticle/56464/
    [Expand]Android Gesture Collection/viewarticle/59748/
    [Expand]Image Repository/viewarticle/59749/
    [Expand]Keyword Testing/viewarticle/59771/
    [Collapse]Low-Level Procedures Collection/viewarticle/59772/
       LLPlayer Object/viewarticle/56754/
      [Collapse]LLPlayer Object Methods/viewarticle/58887/
        KeyDown Method/viewarticle/58896/
        KeyUp Method/viewarticle/58894/
        MouseDown Method/viewarticle/58892/
        MouseMove Method/viewarticle/56755/
        MouseUp Method/viewarticle/58888/
        MouseWheel Method/viewarticle/58889/
    [Expand]Manual Tests/viewarticle/59773/
    [Expand]Name Mapping/viewarticle/59774/
    [Expand]Network Suite/viewarticle/59775/
    [Expand]Tested Applications/viewarticle/59779/
    [Expand]Unit Testing/viewarticle/59780/
    [Expand]User Forms/viewarticle/59781/
    [Expand]Web Services/viewarticle/59782/
   [Expand]Project Objects/viewarticle/59768/
   [Expand]Test Log Objects/viewarticle/59769/
   [Expand]COM Automation Objects/viewarticle/59770/
  [Expand]TestComplete Events/viewarticle/56945/
  [Expand]Language Reference/viewarticle/57879/
  [Expand]User Form Components/viewarticle/56689/
 [Expand]Other Tools That Help You Test Better/viewarticle/63442/
 [Expand]TestComplete Licensing Guide/viewarticle/63451/
Updated: 3/11/2014 Applies To: TestComplete 10 Rating: No votes Click to rate: PoorNot badAverageGoodExcellent
Programming Reference Select language for code samples Select language for code samples

MouseDown Method


Use the MouseDown method to simulate pressing of a mouse button. The method performs the same action as the MouseDown event of a low-level procedure.



Button [in] Required Integer
X [in] Required Integer
Y [in] Required Integer
Delay [in] Required Integer
Result None  

Applies To

The method is applied to the following object:


The method has the following parameters:


A constant specifying the mouse button, the pressing of which is to be simulated. You can use the following constants to specify the mouse button (these constants are provided by the Win32API plug-in).

Constant Integer Value Description
MK_LBUTTON 1 The left mouse button.
MK_RBUTTON 2 The right mouse button.
MK_MBUTTON 16 The middle mouse button.


Specifies the horizontal coordinate of the point for the click.


Specifies the vertical coordinate of the point for the click.


The number of milliseconds passed after you command TestComplete to simulate the pressing of a mouse button and before TestComplete starts simulating the pressing. The delay gives you the possibility to better emulate real-life conditions. Also, it is necessary to separate the pressing from other low-level events in order to enable the operating system to properly process it.

If Delay is negative, it is set to the Auto-wait timeout.

If Delay is greater than 1000, the waiting progress will be shown in TestComplete’s indicator during the test run.

Result Value



The code below simulates pressing the left mouse button and then releasing it using the MouseDown and MouseUp methods.

Show Example

See also
Testing Applications in Low-Level Mode | MouseUp Method | MouseMove Method | MouseWheel Method | Low-Level Procedure Events | MouseDown Method (Desktop Objects) | Simulating Mouse Actions

© 2014 SmartBear Software. All rights reserved.
Email Send feedback on this document