Automate tests on virtual machine without graphical session

0
0

Context :

I execute automated GUI tests on virtual machines (there are few of them) on running on windows and using UFT/Ranorex, executions are piloted by Jenkins.

Problem:

VM must have an active graphic session, otherwise, UFT won’t run GUI tests (unable to launch browser) and Ranorex will run but poorly and without screenshots. i mean that in my tests, the VM is configured not to “sleep” or to have any screen saver, vm is connected with jenkins properly.
The behavior is : i launch via Jenkins the test, one the build done inthe vm, automation tools start running but then finds difficulties to open browser.

I would like to know if there is any workaround to run those tests without being needed to physically open VMware or Remote desktop Connection.
Notice that the VM is running all the time and the session is always open (we are using a server to host the VM).

So the problem is: how to simulate in windows active graphical session. I guess it’s like simulating that there is actually a screen connected even though there isn’t…

Any suggestions will be welcomed.

  • You must to post comments
0
0

Had to go through this many times and you can find a lot of resources related to your issue in the Ranorex Forum. (My username there is Martin for reference).

But to go through the points you need to do quickly:
1) Have an RDP machine to connect to that is used to run your tests
2) You need to disable screen saver for that machine (I had to do it from registry)
3) Then disable the “On Resume, display logon screen” option under Personalize settings for the screen saver
4) And finally create a .bat script with the following content “%windir%\System32\tscon.exe RDP-Tcp#0 /dest:console”

So basically when you have everything set up (required only once) you will run the .bat script. This will close the RDP window BUT the session will be left open with the screen enabled.

Just connect the RDP with Jenkins and you have full functionality that you need to run your tests.

Regards
Martin

  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website