How to automate SAP in background



As the title of this query suggests, I am looking for answer to the issue of SAP automation in the background. Uipath offers two background automation options, either using SendWindowMessage or Simulate Type.

Some of the Uipath Activities offer both ways how to perform automation in background, as an example Type action activity. Unfortunately, not all. Regardless of used Uipath action activity, SendWindowMessage option never worked. In particular, I would like to solve how to execute Click text activity in background.

To be more specific, Uipath performed the activity (meaning that the process successfully completed without error according to UiPath), but SAP did not respond to the command. If I’ve done this activity using default method, the robot performed the operation without any problem.

I wanted to ask if anyone would know how to solve the problem, or at least tell if the problem is rather on the side of SAP or UiPath. For example, that the SendWindowMessage method has its own specifics in use or something like that.

Thank you very much.

Kind regards,



Hi @barbora.m,

Were you able to run SAP in the background? I too am working on automating the order entry process in SAP. However, I can’t seem to run the program in background.


Hi @barbora.m ,

Even I am facing the same problem in SAP, did you able to run SAP in the background?

Thank You!!!


Hi @oshinkavdia and @anshul_nema,

The problem was that after you log off from the serve, the client’s screen was deactivated and the robot could not work. Robot simply stopped recognizing the individual elements.
The solution was to set up an activity in Task Scheduler (PowerShell script), which was triggered every time you logged out of the server. Here’s the PS script. Just remember to change “(client name)” for the name of your client.

PS script:

$output = query session (client name) | findstr /I “ Disc “
#The session id starts at the 38th character and is maximum 9 characters long
$sessionId = $output.Substring(38, 9).Trim()
Tscon $sessionId /dest:console

#write the date and the current sessions so we can see the output when it ran and that it completed successfully
query session (client name)
echo OK

Hope this helps!


Yes! You can automate SAP environment using a SAP’s own automation tool called SAP TAO (Test Acceleration and Optimization). Test Scenario’s involving end to end business flow such as Procurement Cycle, Order to deliver flow etc.

SAP TAO helps to break down the test into components. Components are created and uploaded to QC (Quality Center)and run automated tests on SAP systems.