
SAP Intelligent RPA solution sometimes requires the user to handle applications with low-level actions such as mouse clicks or direct keystrokes simulations. But in certain circumstances, these low-level actions can cause limitations.
Even it's mostly encountered during unattended execution, this behavior isn't limited to this execution mode, as the user can be expected to launch attended scenarios on his machine and let it work while the screen is locked.
The job executes on a user’s machine with its screen locked.
The job executes on a VDI with no active connexion.
These functions literally ask the agent to simulate a mouse click or press a key. It won't work as well when the session is locked or the VDI is disconnected.
Check if the cursor moves to the item position when calling the click action.
ctx.wait(function(ev){
application.page.item.click();
},10000);
To resolve issues with mouse click and keystroke actions, you need to track down and identify those actions. These actions may have been implemented in the project that way, to avoid complicated code or overcome improper item handling by the tool.
ctx.keystroke / application.page.item.keystroke
application.page.item.set()
ctx.mouse.click / application.page.item.clickMouse / click(true)
application.page.item.click()
Setting a value with the standard set method may not work on every website, especially on a website with rich framework (e.g. Bootstrap, Angular …).
Let's describe this on a concrete example. Below website relies on a rich JS framework that makes the following actions whenever an user sets a value in the "Component Search" search bar (highlighted in red):
If the automation developer uses a simple call like this
IRPAComponent.pMain.oSearchBox.set("IRPA");
IRPAComponent.pMain.activate();
IRPAComponent.pMain.oSearchBox.setFocus();
ctx.keyStroke("IRPA");
IRPAComponent.pMain.oSearchBox.set("IRPA");
IRPAComponent.pMain.oSearchBox.trigger("input");
As a result, the tooltip and the corresponding message are displayed and this solution can be applied to desktops with a locked screen.
A more complex web page may require the user to work directly in the browser by analyzing the internal events with web developer mode.
application.page.item.scriptItem( "dispatchEvent( new MouseEvent( 'mouseover', {'bubbles': true, 'cancelable': true}))");
For some Win32 applications, if standard methods oblige you to use low-level click or key stroke actions, you can try by capturing the application with UIAutomation and enable Win32 automations option (only available with version 1.0.8+ of the Desktop Studio).
This option is only available on items with the following class names:
application.page.item.click()
application.page.item.set()
In the Captured Data section, each of these items must also have the capture property hWnd, different from 0x0.
A common best practice is to configure your environment to prevent the screen from locking when it's possible.
This will allow mouse clicks and keystrokes to be used without getting stuck and sent to the screen lock instead of the targeted application.
Same idea here, if you are using a Virtual Desktop Infrastructure and mouse clicks and keystrokes are necessary, you can:
Configure the Virtual Desktop Infrastructure to prevent the screen from locking.
Directly connect to a Virtual Desktop Infrastructure from a local machine.
Eventually you may have a project that launches this connection from a local machine.
If all the resolutions previously suggested do not work, try to find a functional workaround. Another sequence of screen, another button to click on, if any other way to validate your form may also work without needing a mouse click or a keystroke.
If none of the workarounds apply, it may become a blocker for your project.
Use action + delay + manual screen lock
Perform regular tests on a disconnected Virtual Desktop Infrastructure or on a machine with a locked screen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
16 | |
15 | |
13 | |
9 | |
9 | |
9 | |
8 | |
7 | |
7 | |
6 |