Agents Session

Run QualityMate on Interactive mode agents

Some QualityMate interactions use the operative system API to perform them; thus, it requires an active user session. When there is no active session, the operative system could prevent some calls from being executed, producing unexpected results, or even test crashes on the following scenarios:

  • The user locks the PC when QualityMate is running.

  • The PC enters sleep or hibernate mode when idle.

Considerations to run correctly

Locally on agents

  • Disable screensaver by typing the following shortcut on the Run window (Win + R) control desk.cpl,,1

  • Disable sleep mode by running the following command in a console as admin: Powercfg /x -standby-timeout-ac 0

  • Disable screen sleep by running the following command in a console as admin: powercfg /x -monitor-timeout-ac 0

  • Disable Hibernate by running the following command in a console as admin: powercfg /x -hibernate-timeout-ac 0

On remote connection

When using an interactive agent that uses a Remote Desktop Protocol (RDP), the remote session will work as a local one, and the operative system will provide privileges to perform UI interactions. If the remote session is closed abruptly or finished by clicking the close button, the agent's session will lock, preventing the interactions from executing correctly.

The user needs to end the connection correctly to avoid the session being locked. On Windows OS, this can be achieved by using tscon.exe located at the%windir%\system32 folder.

The following script example can be used to prevent the issue at hand; this can be copied and pasted in a CLI or saved into a file.

@echo off
echo Session...
query session

for /f "skip=1 tokens=3" %%s in ('query user %USERNAME%') do (        
    echo SessionID: %%s
    %windir%\System32\tscon.exe %%s /dest:console
)
%windir%\System32\qres.exe /x 1920 /y 1080
echo. 
pause

For more information, visit Microsoft UI test considerations.

Last updated