'Using GitLabRunner to execute GUI tests on windows with permanent active user session
i'm having issues to get a permanent active user-session on my virtual machine to execute gui tests developed with the functional testing tool Ranorex Studio via GitLab-Runner (Windows / Shell). The testsuite is based on a .NET solution which is built via MSBuild.exe and the output (bin/debug/*.exe) will be executed with some parameters via command line.
Procedure:
- Start gitlab-runner via PowerShell as administrator with "gitlab-runner run" command
 - Make some changes in GitLab-Repository to start the pipeline via .yml-File
 - Ranorex test-project is built successfully and is starting the GUI-tests
 - In the first run the user session is active and the tests are going to be executed and interacting with the GUI, but when i try to trigger the pipeline again for further runs, the user-session turns to false and there is no interaction with the GUI (black sceenshots in test-report).
 
Already did:
- Screensaver disabled
 - StandBy-Mode disabled
 - User-Access-Control on lowest setting
 - Lock-Screen disabled
 - Secure-Login disabeld
 - Remote connections enabeld
 - Ports openend
 - Keep Session open via .batch-File, when closing RDP-connection
 - GitLab-Runner Service => Log on with respective AD-User (equipped with admin-rights)
 - AD-User is alway logged in on virtual machine
 
With Jenkins (Master / Slave configuration) everything works fine
Would be grateful for any help!
Solution 1:[1]
Does your Ranorex process close down properly with an exit code? Does the Application Under Test also close down properly at the end? I am assuming something has locked - you could try a bit of Powershell to close the processes before a test run. One thing I had to do was keep the screen on - using a utility like 'Caffeine'.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source | 
|---|---|
| Solution 1 | DharmanBot | 
