How to prevent the Agent machine from logging out/going into sleep mode?
How to prevent the Agent machine from logging out/going into sleep mode?
By default, Windows Power and Sleep settings are configured in a way that the screen gets locked after a specific interval of time. To make sure that the agent machine is not locked due to power and sleep mode settings, users must perform the below two steps:
Turn off Power and Sleep mode settings
Turning off Power and Sleep mode settings will ensure that your agent machine doesn't get locked or goes to sleep mode automatically.
Note: Due to security policy requirements, some organizations do not allow switching off "Power and Sleep" mode settings on development/test machines. In that case, host your Agent on a virtual machine and perform the below Power and Sleep mode changes there.
Disable automatic Sleep
Windows 10:
- In Windows 10, open Power Options by right-clicking on the start menu and clicking on Power Options.
- In case of a local desktop, set all options in Sleep to "Never". If the Agent is on a Windows 10 VM, then set all options in Power & Sleep to "Never".
Windows 8:
- In Windows 8, open Power Options by right-clicking on the start menu and clicking on Power Options.
- Click on "Choose when to turn off the display".
- In case of a local desktop, set all options in "Put the computer to sleep" to "Never". If the Agent is a Windows 8 VM, then set all options in "Turn off the display & Put the computer to sleep" to "Never".
- Click the Save changes button.
Windows 7:
- Open Power Options by clicking the Start button, clicking Control Panel, clicking System and Security, and then clicking Power Options.
- On the Select a power plan page, click the Change plan settings option next to the selected plan (opted by the radio button).
- Set all options in "Turn off the display & Put the computer to sleep" to "Never".
- Click OK, and then click Save changes.
Windows Server 2008 & 2012:
- Open Power Options by clicking the Start button, clicking Control Panel, clicking System and Security, and then clicking Power Options.
- On the Choose or Customize a power plan page, click Change plan settings option next to the selected plan (opted by the radio button).
- Set all options in "Turn off the display & Put the computer to sleep" to "Never".
- Click OK, and then click Save changes.
Change Agent Config
You can do that by modifying the configuration file for Leapwork Agent:
- Close the Studio, stop the Agent in Windows services:
- Open a run box by pressing the Windows key + R:
- Type ‘services.msc’ and press OK.
- Find “Leapwork Agent" in the list of services.
- Select “Stop” if the service is running.
- Open the Agent configuration file
C:\Program Files\Leapwork\Agent\agent.configin Notepad. - Add the following text string to the end of the text file: "KeepDisplayActive": true
- Make sure to add “,” at the end of the second last line in the config, and save the file.
- Start the Agent service (see point 1).
- Open Leapwork Studio.
- Refresh the Controller in the Studio Settings by hitting refresh in Controller settings.
- Check whether the agent machine logs out by monitoring the screen for a while.
- In case it doesn’t work, stop the Agent service again and check whether you have entered everything correctly in the config file.
Note: If you have the Controller and the Agent on a remote machine (other than Studio), scheduling will still work even if the Studio is switched off. It is the Controller that is responsible for running the scheduled test cases. So as long as the controller and the agent(s) are running, the schedules can be executed.
For any clarification, please contact our Priority Support.