How to resolve the RDC issue when GUI Testing on a windows Jenkins agent

2,043 views
Skip to first unread message

Kelvin Lei

unread,
Oct 17, 2013, 10:26:48 PM10/17/13
to jenkins...@googlegroups.com

I have a jenkins agent set up on window 7, and I am running GUI testing on it. It runs fine if I have a remote desktop connection open, but fail otherwise. I found this link, Jenkins on Windows and GUI Tests without RDC

But the solution provided there is pretty vague. Could you any please clearly teach me how to solve this? Much appreciated!

Kelvin Lei

unread,
Oct 18, 2013, 3:19:45 AM10/18/13
to jenkins...@googlegroups.com
It's connected via Java Web Start btw

Fred G

unread,
Oct 18, 2013, 9:27:52 AM10/18/13
to jenkins...@googlegroups.com
Hi,

I'm currently running GUI tests on a Windows Server 2008 slave without any problems.
What I found out is, that the slave has to be connected via Java Web Start. (It did not work running the slave as a Windows service - even with access to the desktop).
A user has to be logged on and both screensaver and auto-log out should be deactivated.
I never connected to the slave via Remote Desktop Connection (RDC), only VNC.

I'm not sure if it depends on the kind of GUI tests you are running.
In my case they are Eclipse based GUI tests (running with WindowTester Pro).

So while I can't give you detailed instructions how to fix your specific problem, I can report that it's working for me at least. So there is a way! :)
I'd suggest trying to disable RDC and use VNC instead, if that is an viable option.

Regards,

Fred

Hugo Arès

unread,
Oct 18, 2013, 11:14:05 AM10/18/13
to jenkins...@googlegroups.com
I had the same issue. GUI testing framework/tools require access to windows desktop or they won't work. So prior to Windows Vista/Server 2008, you could have started slave as a service since windows services were running in the session 0 which is the session of user currently logged on the computer (console session). From Vista/Server 2008, the services are still running in session 0 BUT this session is no longer attacked to a desktop so the jenkins slave that will run GUI testing cannot be started as a window service.

The other known issue of GUI testing framework/tools on Windows is that they work work if the windows session is locked/disconnected. This explains why it is working when you are connected with remote desktop but fails otherwise because when you disconnect, it is doing the equivalent of locking your screen and the window session state is disconnected.

I am doing the same as Fred suggested to prevent the issue: auto-logon a user on the slave, install VNC and disable RDC. You also need to make sure you never lock the screen.

Hugo

Kelvin Lei

unread,
Oct 18, 2013, 1:33:04 PM10/18/13
to jenkins...@googlegroups.com
I think I already auto-logon the windows slave. Is there a way to double check? I am not familiar with VNC. Could you please show me how to install and configure the VNC? Thanks a lot.

Kelvin Lei

unread,
Oct 18, 2013, 1:38:14 PM10/18/13
to jenkins...@googlegroups.com
I think I already auto-logon the windows slave. Is there a way to double check? I believe I am launching the slave via Java Web Start, because it would show 'connected via JLNP agent'.  I am not familiar with VNC. Could you please show me how to install and configure the VNC? Thanks a lot.

Justin Mulcahy

unread,
Oct 20, 2013, 6:29:54 AM10/20/13
to jenkins...@googlegroups.com
if you try the following steps it should solve your problem

1. Right click on the Desktop and select New → Shortcut
2. Enter the following %windir%\System32\tscon.exe 1 /dest:console
3. Click Next, enter a name for the shortcut and then click Finish. The name can be anything you like.
4. On Windows 7/Vista hosts, this shortcut needs to be run with administrator privileges. Right click on the newly created shortcut and select Properties
5. Click the Advanced button on the Properties window.
6. Check the box marked Run as administrator and then click OK.
7. Pin the shortcut to the Start menu or the taskbar and click it when you would like to disconnect

Kelvin Lei

unread,
Oct 21, 2013, 12:22:18 AM10/21/13
to jenkins...@googlegroups.com
Thanks. But how is it going to help with the GUI testing? I don't think the test machine will ever get disconnected since it's just a virtual machine.
Reply all
Reply to author
Forward
0 new messages