Keeping your remote session active when using Runner

Keeping your remote session active when using Runner

In some cases where a VM is used to run the automation, keeping the remote session active is necessary to avoid problems with the graphical interface, such as the OSError: screen grab failed error. This error is usually thrown when trying to perform an automation that uses computer vision to find elements in an environment where the remote connection has already been closed. This is because when closing the connection, the operating system will make the screen black, preventing bots from capturing the screen and making it impossible to search for graphic elements.

For this, BotCity offers two scripts to run bots that use the graphical interface of the environment without having to be connected to the session. These scripts disconnect the user's current session and redirect it to a terminal session, keeping the session and graphical interface active for BotCity Runner.

These scripts are available within the BotCity Studio SDK folder and can be used in the Runner execution settings. You can choose to execute them by starting the Runner using the startup parameter or before each task that the Runner will perform through the beforeTask parameter.

Available Scripts:

startup.bat: This script is available in the startup folder, and by setting it in the Runner configuration file, it will disconnect the current session and redirect it to a terminal session.
console_session.bat: This script is available in the scripts folder, and by setting it in the Runner configuration file, it will also have the function of disconnecting the current session and redirecting it to a terminal session, but also has the option to define the screen resolution for this new session.

See more details on the use and implementation of these scripts in the Keeping your remote session active documentation.


Important:
After configuration, you must start Runner with administrator privileges for the scripts to run.