DragR Action

Applies to TestComplete 15.20, last modified on January 19, 2022

Description

Use the DragR action to simulate a dragging event that is performed with the right mouse button over an onscreen object or window.

Declaration

TestObj.DragR(ClientX, ClientY, toX, toY, Shift)

TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section
ClientX [in]    Required    Integer    
ClientY [in]    Required    Integer    
toX [in]    Required    Integer    
toY [in]    Required    Integer    
Shift [in]    Optional    TShiftKey Default value: skNoShift   
Result None

Applies To

All onscreen objects.

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:

ClientX

Specifies the horizontal coordinate of the start point for DragRging. This coordinate is relative to the object, it is not a screen coordinate.

ClientY

Specifies the vertical coordinate of the start point for DragRging. This coordinate is relative to the object, it is not a screen coordinate.

toX

Specifies the horizontal DragRging distance in pixels.

toY

Specifies the vertical DragRging distance in pixels.

Shift

Sets whether the Shift, Alt or Ctrl keys are pressed during the DragRging event (see TShiftKey). By default, this parameter is skNoShift (no shift keys are pressed). Sometimes the Shift parameter may not be enough, and you may need to simulate key presses in script code. See Simulating Keystrokes.

Result Value

None.

Remarks

  • The DragR action works in the following manner:

    • Moves the mouse cursor to the point specified by the ClientX and ClientY parameters.
    • “Presses” the right mouse button.
    • “Holds” the button down and moves the cursor to the distance specified by the toX and toY parameters.
    • “Releases” the right mouse button.
  • Desktop testing: If TestObj refers to an object of a non-DPI-aware application running with a DPI setting other than 100%, set the ClientX, ClientY, toX and toY parameter values relative to the application (as if the application is running with the 100% DPI setting).

  • Web testing: If the Use CSS pixels for scaled pages option is enabled (by default), set the ClientX, ClientY, toX and toY parameter values relative to the web page, regardless of the browser zoom and the system's DPI setting.

  • In order to simulate dragging actions on Telerik RAD controls for Silverlight, increase the value of the Dragging delay project option (default value is 5 milliseconds, recommended value is 50 milliseconds or higher). Otherwise the dragging actions may not be simulated correctly.

See Also

Simulating User Actions
Drag Action
DragM Action
Click Action
DblClick Action
MouseDown Method (Desktop Objects)
MouseUp Method (Desktop Objects)

Highlight search results