Jenkins Setup Error

Ask general questions here.
johnzer
Posts: 16
Joined: Thu Aug 18, 2016 9:27 pm

Jenkins Setup Error

Post by johnzer » Tue Oct 04, 2016 6:00 am

Hello,

We've been working on getting Jenkins to run on virtual machines. So far, we have resolved the issue with a UI process not being started. Our current problem, however, is that, while the UI process starts on the slave machine, test execution does not proceed! It seems that the slave machine is not executing mouse clicks and other such commands.

Any advice?

Ranorex Version: 6.1

Windows Version: Windows 2008 R2

Jenkins: 2.6

.NET Framework: 4.0

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Jenkins Setup Error

Post by odklizec » Tue Oct 04, 2016 8:04 am

Hi,

It's hard to say what's wrong without examining your Jenkins setup. The most common mistake people do is setting Jenkins server or slave as a Windows service. You must run Jenkins master or slave from a command line (as described >here<)
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

johnzer
Posts: 16
Joined: Thu Aug 18, 2016 9:27 pm

Re: Jenkins Setup Error

Post by johnzer » Tue Oct 04, 2016 8:38 am

After doing a little bit of experimenting, I think I've found my issue.

The desktop is being locked after I close Remote Desktop Connection, so while GUI apps are being launched properly, they cannot receive input.

Does anyone know how to keep the session active after dc'ing from Remote Desktop?

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Jenkins Setup Error

Post by odklizec » Tue Oct 04, 2016 8:57 am

Sadly, the only way how to keep the automation running (after RDP session) is to keep the RDP open. It must not even be minimized! Eventually, you need to restart the slave after RDP session and restart your test. The only other way around is to use some kind of VNC instead of RDP. VNC connection keeps open, even after minimizing/closing the VNC window.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

Martin
Posts: 152
Joined: Fri Aug 15, 2014 12:24 pm

Re: Jenkins Setup Error

Post by Martin » Tue Oct 04, 2016 11:03 am

It's actually quite easy to keep the RDP connection and session open after closing the RDP window locally. Basically you need a .bat script and some registry editing. If you haven't found a solution yet you can write me and i can explain a little further. Don't have time to currently add it to this post.

Martin

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Jenkins Setup Error

Post by krstcs » Tue Oct 04, 2016 1:36 pm

I use VNC for this issue and it works very well. Much easier than trying to get RDP working and you don't have to edit the registry manually. And if you are on a domain, the registry edit may not work in some situations.

One other thing to know is that if your VMs are configured to lock after a timeout, you will need to find a way to unlock them or it doesn't matter if you use VNC or anything else, Ranorex won't work on locked systems. To get around this I use AutoLogon. It's not free, but it's pretty cheap. It allows you to pass a command-line from Jenkins that will unlock the system, and then you can lock it back after the test is done.
Shortcuts usually aren't...

tvu
Posts: 195
Joined: Tue Apr 07, 2015 10:47 pm

Re: Jenkins Setup Error

Post by tvu » Thu Oct 13, 2016 1:44 am

You can use the following command to end a RDP session and leave the screen unlock.

tscon.exe rdp-tcp#0 /dest:console

I put that command in a batch file on the desktop. I just double click on the batch file when I want to end the RDP session.

johnzer
Posts: 16
Joined: Thu Aug 18, 2016 9:27 pm

Re: Jenkins Setup Error

Post by johnzer » Tue Oct 25, 2016 5:40 pm

tvu wrote:You can use the following command to end a RDP session and leave the screen unlock.

tscon.exe rdp-tcp#0 /dest:console

I put that command in a batch file on the desktop. I just double click on the batch file when I want to end the RDP session.
As an update, I ended up doing this with a minor modification.

I created a Session_ID environment variable which was set upon log-on, and scheduled the tscon.exe script to run using that upon workstation lock, which made the process much easier for my team.