Click operations
When you run your tests, Tosca Cloud interacts with the screen elements in your application to ensure your workflows behave as expected. Typically, these interactions include the following:
-
Value interactions, where you insert, verify, or save data.
-
Click operations, where Tosca Cloud navigates your menus and buttons.
For click operations, set the Action to Input and enter one of the following commands:
Click operation |
Description |
{ALTCLICK} |
Performs a left click while holding the Alt key down. |
{CLICK} |
Click with the left mouse button. |
{CONTROLCLICK} |
Performs a left click while holding the Ctrl key down. |
{DOUBLECLICK} |
Double click with the left mouse button. |
{DRAG} |
Selects the object to be repositioned. The object in question must support drag and drop operations. |
{DROP} |
Inserts an object that was previously selected with {DRAG}. |
{LONGCLICK} |
Click with the left mouse button which lasts for two seconds. |
{MOUSEOVER} |
Moves the mouse pointer over the control. |
{RIGHTCLICK} |
Click with the right mouse button. |
{SHIFTCLICK} |
Performs a left click while holding the Shift key down. |
You can use the value X instead of {CLICK} for left clicks. X instructs Tosca Cloud to perform a click without using the mouse and it verifies whether or not the control is disabled.
Define the click position for CLICK
You can define an offset for the click operations {CLICK} and {LONGCLICK}. Use square brackets and define your offset in pixels px or in percent % relative to the top left corner of the control area with the syntax {Click[OffsetHorizontal][OffsetVertical]}.
Define mouse movements and click positions
Use the syntax {MOUSE[Action][MoveMethod][OffsetHorizontal][OffsetVertical]} to define a mouse operation including mouse movements and offsets.
The Action parameter defines the click operation to perform. You can specify the following values:
Action |
Description |
CLICK |
Click with the left mouse button. |
DOUBLECLICK |
Double-click with the left mouse button. |
DRAG |
Selects the object with the left mouse button for repositioning. The object must support drag and drop operations. |
DROP |
Inserts an object that was previously selected with DRAG or RIGHTCLICKDRAG. |
LONGCLICK |
Click with the left mouse button which lasts for two seconds. |
MOUSEOVER |
Moves the mouse pointer over the control. |
RIGHTCLICK |
Click with the right mouse button. |
RIGHTCLICKDRAG |
Selects the object with the right mouse button for repositioning. The object must support right-click drag and drop operations. |
You can specify the following values for the parameter MoveMethod:
MoveMethod |
Description |
Jump |
The mouse pointer jumps directly to the clicked location. |
Smooth |
The mouse pointer moves smoothly towards the clicked location. |
HorizontalFirst |
The mouse pointer moves along the horizontal axis first. |
VerticalFirst |
The mouse pointer moves along the vertical axis first. |
Specify the offset parameters OffsetHorizontal and OffsetVertical in pixels px or in percent % relative to the top left corner of the control area.
Jump to a specific location
The syntax {JUMPTO[Action][OffsetHorizontal][OffsetVertical]} allows you to jump to a specific location and perform a click operation.
Optionally, specify the offset parameters OffsetHorizontal and OffsetVertical in pixels px or in percent % relative to the top left corner of the control area.