SAP Help Home SAP Intelligent RPA Help Portal SAP Intelligent RPA Community

Module - Mouse

Collection of functions related to mouse emulation. Most of the activities require a Windows session unlocked to work properly.

Activities

Mouse Left Click

Emulate a mouse left-click at a given position.


Technical Name Type Minimal Agent Version
click asynchronous WIN-3.24, MAC-3.24

Input Parameters:

Name Type Attributes Default Description
X number mandatory Position or relative horizontal position (compared to desktop top left position) of the object.
Y number optional Relative vertical position (compared to desktop top left position) of the object. If 'X' is an "irpa_core.position" object, this parameter is ignored.
doubleClick boolean optional If this parameter is set to true, it triggers a double click.

Sample Code:

// double click on item1 const pos = await myApp.screens.myPage.elements.btOK.getRect(); await irpa_core.mouse.click(pos, 0, true);



Mouse Middle Click

Emulate a mouse middle-click at a given position.


Technical Name Type Minimal Agent Version
clickMiddle asynchronous WIN-3.24, MAC-3.24

Input Parameters:

Name Type Attributes Default Description
X number mandatory Position or relative horizontal position (compared to desktop top left position) of the object.
Y number optional Relative vertical position (compared to desktop top left position) of the object. If 'X' is an "irpa_core.position" object, this parameter is ignored.
doubleClick boolean optional If this parameter is set to true, it triggers a double click.

Sample Code:

// middle click on item1 const pos = await myApp.screens.myPage.elements.btOK.getRect(); await irpa_core.mouse.clickMiddle(pos, 0, true);



Mouse Right Click

Emulate a mouse right-click at a given position.


Technical Name Type Minimal Agent Version
clickRight asynchronous WIN-3.24, MAC-3.24

Input Parameters:

Name Type Attributes Default Description
X number mandatory Position or relative horizontal position (compared to desktop top left position) of the object.
Y number mandatory Relative vertical position (compared to desktop top left position) of the object. If 'X' is an "irpa_core.position" object, this parameter is ignored.
doubleClick boolean optional If this parameter is set to true, it triggers a double click.

Sample Code:

// right click on item1 const pos = await myApp.screens.myPage.elements.btOK.getRect(); await irpa_core.mouse.clickRight(pos);



Drag & Drop

Emulate a drag-and-drop behavior between two positions (source and destination).


Technical Name Type Minimal Agent Version
dragAndDrop asynchronous WIN-3.24, MAC-3.24

Input Parameters:

Name Type Attributes Default Description
X number mandatory Position or relative horizontal position (compared to desktop top left position) of the object for the source.
X2 number mandatory Position or relative horizontal position (compared to desktop top left position) of the object for the target.
Y number optional Relative vertical position (compared to desktop top left position) of the object. If 'X' is an "irpa_core.position" object, this parameter is ignored.
Y2 number optional Relative vertical position (compared to desktop top left position) of the object. If 'X2' is an "irpa_core.position" object, this parameter is ignored.

Sample Code:

const pos1 = await myApp.screens.myPage.elements.edText.getRect(); // source const pos2 = await myApp.screens.myPage.elements.edTree.getRect(); // destination await irpa_core.mouse.dragAndDrop(pos1, pos2);



Drag & Drop Right

Emulate a drag-and-drop behavior between two positions (source and destination).


Technical Name Type Minimal Agent Version
dragAndDropRight asynchronous WIN-3.24, MAC-3.24

Input Parameters:

Name Type Attributes Default Description
X number mandatory Position or relative horizontal position (compared to desktop top left position) of the object for the source.
X2 number mandatory Position or relative horizontal position (compared to desktop top left position) of the object for the target.
Y number optional Relative vertical position (compared to desktop top left position) of the object. If 'X' is an "irpa_core.position" object, this parameter is ignored.
Y2 number optional Relative vertical position (compared to desktop top left position) of the object. If 'X2' is an "irpa_core.position" object, this parameter is ignored.

Sample Code:

const pos1 = await myApp.screens.myPage.elements.edText.getRect(); // source const pos2 = await myApp.screens.myPage.elements.edText2.getRect(); // destination await irpa_core.mouse.dragAndDrop(pos1, pos2);



Mouse Move

Emulate a mouse movement to a given position.


Technical Name Type Minimal Agent Version
move asynchronous WIN-3.24, MAC-3.24

Input Parameters:

Name Type Attributes Default Description
X number mandatory Position or relative horizontal position (compared to desktop top left position) of the object.
Y number mandatory Relative vertical position (compared to desktop top left position) of the object. If 'X' is an "irpa_core.position" object, this parameter is ignored.

Sample Code:

const pos = await myApp.screens.myPage.elements.btOK.getRect(); // source await irpa_core.mouse.move(pos);



Scroll Wheel

Emulate a mouse wheel scroll at a given offset. Positive value scrolls down, while negative value scrolls up.


Technical Name Type Minimal Agent Version
scrollWheel asynchronous WIN-3.24, MAC-3.24

Input Parameters:

Name Type Attributes Default Description
offset number mandatory Scroll wheel offset (positive value scrolls down, negative value scrolls up).

Sample Code:

await irpa_core.mouse.scrollWheel(-200);