Share this page

# rdp_sync_object_mouse_click

Executes a mouse click operation on an object when the object has the specified attribute value.

Synchronization Functions

int rdp_sync_object_mouse_click( "StepDescription=<step_description>", "Snapshot=<snapshot>", ["ConnectionID=<connection_identifier>",] ["WindowTitle[/RE]=<window_title>", ]["WindowOrdinal=<window_ordinal>",] "Attribute=<attribute>", "Value=<value>", "MouseX=<x_position>", "MouseY=<y_position>", "MouseButton=<mouse_button>", ["KeyModifier=<key_modifier>",] ["Timeout=<timeout>",] ["FailStepIfNotFound=<Default | Yes | No>",] RDP_LAST );

This function returns one of the following:

LR_PASS (0): The function completed without error.

LR_FAIL (1): The function completed with errors.

LR_NOT_FOUND (2): The function's FailStepIfNotFound argument is set to No and the object does not have the specified attribute before timing out.

LR_PASS does not indicate that the test step passed-only that the function ran to completion. For example, LR_PASS does not indicate that the server returned the expected value.

All string arguments (char type) can be parameterized using standard parameterization.

Argument | Description
--- | ---
StepDescription | A descriptive, unique name for this step. Use any text.
Snapshot | The name of the snapshot file of the screen state before this step.
ConnectionID | The name of the connection on which this function operates. Do not change the recorded ID. If several connections are open and the ID is not specified, the first connection in the script is used. If only one connection is open, the connection ID is not required.
"WindowTitle=" "WindowTitle/RE=" | The title of the window. The value for Title is a literal string, for example, `"Title=Quality Center"`. If you use WindowTitle/RE, the value is a regular expression, for example, `"WindowTitle/RE=^Document[0-9]+ - Microsoft Word"`.
WindowOrdinal | The 1-based index of the window among the session windows that match the title specified by WindowTitle or WindowTitle/RE. For example, if the WindowTitle/RE and WindowOrdinal arguments are `"WindowTitle/RE=Document[0-9]+ - Microsoft Word"` and `"WindowOrdinal=3"`, the window specified is the third window in the creation order of the existing windows whose title matches the regular expression `"Document[0-9]+ - Microsoft Word"`. If this optional argument is omitted, the default value is 1.
Attribute | One of the Object Attributes constants.
Value | The value of the attribute.
MouseX | The horizontal distance of the object and mouse click from the left edge of the window.
MouseY | The vertical distance of the object and mouse click from the top edge of the window.
MouseButton | The mouse button clicked. The mouse buttons are: LEFT_BUTTON, MIDDLE_BUTTON, and RIGHT_BUTTON. Use a comma-separated list to indicate that more than one button is clicked, for example: "MouseButton=M1,M2".
KeyModifier | The modifier key pressed while performing this operation. Use a comma-separated list to indicate that more than one key is used, for example: "KeyModifier=M1,M2" Optional
Timeout | The wait time in seconds. If the timeout is exceeded, the function returns LR_FAIL. If no timeout is passed, the default value is taken from the runtime settings.
FailStepIfNotFound | Possible values: Yes, No, or Default. If the object does not have the specified attribute and this argument is set to No, the function returns LR_NOT_FOUND (2).
RDP_LAST | The delimiter marking the end of the argument list.

The rdp_sync_object_mouse_click function is a synchronization function that suspends the script run until one of the following occurs: An attribute of a specific object has a certain value, or the function times out. If the object's attribute does have the specified value, and the control is not covered by another window, the function executes a mouse click operation on the object.

The execution of this function requires the RDP agent to be installed on the RDP Server.

The rdp_sync_object_mouse_click function is generated automatically during code generation when the Use RDP Agent RDP advanced code generation option is selected.

# Object Attributes

Objects have the following attributes:

Attribute Name | Applies to: | Values
ENABLED | All objects | "TRUE" or "FALSE"
FOCUSED | All objects | "TRUE" or "FALSE"
CHECKED | Check box, radio button | "TRUE" or "FALSE"
LINES | List box, combo box | String representation of number of lines the list contains (Decimal representation).
TEXT | All objects | Text
CONTROL_ID | All objects | String representation of the object's control ID (Decimal representation).
ITEM_TEXT | List box, combo box Note that a line in a list box may be highlighted to indicate the current mouse position. This does not indicate that the item is selected. | The text of the selected item. For a combo box, this is the item in the text box. For a list box, it is the last item clicked.

## Example

The following shows a script waiting for a specific Notepad window to become in focus and for a specific object to have a certain attribute. When the window is in focus, the mouse is clicked at horizontal position 27 and vertical position 14.

rdp_sync_object_mouse_click (

"StepDescription=Synced Mouse Click on Object 1",

"Snapshot=snapshot1.inf",

"WindowTitle=Notepad",

"Attribute=CONTROL_ID",

"Value=7",

"MouseX=27",

"MouseY=14",

"MouseButton=LEFT_BUTTON",

RDP_LAST );

Tips to improve your search results... VuGen Function Reference Version 26.1 Function Reference 26.1 All View Local Help Center View Online Help Center Version: