I am currently using Robot Framework to automate interactions with a web page, specifically clicking buttons on the page. I’ve encountered an issue where the script fails or terminates if the laptop screen gets locked during execution.
My questions are:
Is it possible for Robot Framework scripts that interact with a web page’s GUI (e.g., clicking buttons) to run successfully while the screen is locked?
What configurations or settings can be applied to ensure that these GUI-based scripts continue to operate even when the system screen is locked?
Are there recommended practices or alternative approaches for running GUI automation scripts when the screen may be active or locked?
Your guidance on this would be greatly appreciated.
The GUI tests for “any” testing framework, requires access to the screen. If it is locked then the user cannot interact with it, and logically, an automated system cannot too.
I my testing on Windows systems, I prepare the machine under test, to:
Autologin with the proper user
Disable screensaver
Disable screen lock
Configure power settings, to no suspend/hibernate (screen can stay off, but not disk or other relevant devices)
Care to not have other users doing login
If this causes security issues, we can use a Virtual Machine, or a remote machine that we know physical access is limited.
Depends which Library you’re using to automate with?
if it’s SeleniumLibrary or Browser Library, then maybe running with headless mode will solve your issue?
If it’s another Library then see Helio’s answer above. I’ve had good results with connecting with RDP into the test machine and then running the test, you can then minimise the RDP session so you don’t accidentally interact with it, even if your local machine locks the tests continue to run in the RDP session.
I wrong a post a long time back with links to details to some of the techniques mentioned by others here. May be worth a look. Also consider VNC as an option besides RDP and VMs