Page 1 of 2

Running Ranorex tests (remotly) using jenkins - fails

Posted: Thu May 04, 2017 6:42 am
by yam
Hi,
I have a Ranorex UI test suite that runs every 1AM, triggered by Jenkins.
Jenkins triggers the Ranorex tests on a remote computer – master/slave configuration (Jenkins as master and its slave nodes, where the Ranorex automation should be triggered, are not started as a service).
Ranorex agent is installed on the slave computer (keep session active is marked).
RDP, with the Ranorex tests (Jenkins slave computer), is opened via Jenkins master computer.

When I run the tests using Jenkins, RDP session is opened, everything works fine.
The problem is that as it runs at 1AM, the Jenkins master computer gets locked and so is the RDP session (with the Ranorex tests). This causes the tests to fail – it does not recognize UI controls (shows black screen).

Any ideas how to solve this problem?

** I’ve read the article describing the integration with Jenkins and also googled this problem – nothing helped.
** My Ranorex version is 6.0.1

Re: Running Ranorex tests (remotly) using jenkins - fails

Posted: Thu May 04, 2017 4:09 pm
by krstcs
First, make sure to update Ranorex to a current version as there are numerous bug fixes since 6.0.1 (6.2.1 and 7.0.1 are current).

Second, you should use a VNC system instead of RDP (I use TightVNC). RDP is unreliable and prone to issues such as what you are seeing. VNC makes it so that you don't need an active connection with the client/slave, but the remote system will still think there is an active desktop. (You can do this with RDP, but it requires jumping through more hoops, including registry editing, which I highly discourage!)

Finally, your Jenkins system should really be on a server os, if you can, which should be set to not sleep. And you won't need it's desktop to be unlocked if you use VNC.

Re: Running Ranorex tests (remotly) using jenkins - fails

Posted: Tue May 09, 2017 9:16 am
by yam
Upgrading to 7.0.1 will take some time...
so meanwhile I've done the following:
1. Moved Jenkins master to a server computer.
2. I've installed TightVNC on Jenkins master computer and on a the slave computer (and opened a connection to the slave computer from Jenkins master computer).

Now, I've run Jenkins ranorex test job from a 3rd computer (my computer).
Same problem - test fails. It does not recognize UI controls.
In this configuration the test never succeeds. Not with TightVNC and not with an open RDP (succeeds only when I run it locally from the slave computer, without Jenkins).

Any ideas what am I doing wrong?

Re: Running Ranorex tests (remotly) using jenkins - fails

Posted: Tue May 09, 2017 9:46 am
by odklizec
Hi,

I'm not quite sure why you need VNC at all? If the Master-Slave communication is properly configured, your tests should work just fine on slave machine and without the need to use VNC. But maybe I misunderstand something? ;)

How do you connect from Master to Slave? Are you starting your app directly on slave machine?

Make sure the slave is not started as a service! The best is to use JNLP connection for master/slave communication. At least it works great or me. I'm currently using 1 master and 4 slaves, running 24x7 in vSphere.

Re: Running Ranorex tests (remotly) using jenkins - fails

Posted: Tue May 09, 2017 10:40 am
by yam
I'm using JNLP connection for master/slave communication and it works fine.
I'm able to run the test, the problem is that my Ranorex test is a UI test, so it fails - it does not recognize UI controls (in the reports it shows black screens).
I get the following error:
"Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation"

** I'm running Jenkins Ranorex job from a 3rd computer (not from Jenkins master)

I have no idea how to continue. I've googled this issue and nothing helped :|

Re: Running Ranorex tests (remotly) using jenkins - fails

Posted: Tue May 09, 2017 3:26 pm
by krstcs
You only need VNC on the remote system and your development system, not on the server. Jenkins should be running the test on the remote systems not on the server. (I would highly recommend NOT installing VNC on any server system as it can be a security issue.)

Also, a black screenshot usually means that the remote system is locked. Ranorex requires that the system have a fully realized, unlocked desktop. Make sure your desktop is unlocked on the remote system.

Re: Running Ranorex tests (remotly) using jenkins - fails

Posted: Thu May 11, 2017 7:00 am
by yam
I've configured my environment as you said.
Also, I've upgraded Ranorex to version 7.
Still not working....

Re: Running Ranorex tests (remotly) using jenkins - fails

Posted: Thu May 11, 2017 7:10 am
by odklizec
In my opinion, there is something terribly wrong in your master-slave configuration. If JNLP is properly configured and the slave machine is logged-in, slave should stay online, with realized desktop and Ranorex should not have a problem running on such machine. It works great for me, with only occasional hiccups, when our company policy/admins decide to restart the machine due to windows updates. But even then, the machine is restarted and automatically logged-in, so the restart breaks only the actually running tests (I really hate this), but then it works as expected.

Are you sure, there is no Jenkins service running in background of the slave machine?

Re: Running Ranorex tests (remotly) using jenkins - fails

Posted: Thu May 11, 2017 7:58 am
by yam
Jenkins slave is not running as a service.

This is what I've done so far:
1. Jenkins master computer (not running as service)
2. Jenkins slave computer for running Ranorex UI test (not running as service)
3. Jenkins host computer for triggering Ranorex job.
4. From Jenkins host computer, I've opened RDP/VNC connection (I've tried both) to Jenkins slave computer.
5. I've triggered Ranorex UI Test from Jenkins host. Test begins to run but it fails when it tries to access the UI (Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation.)

Re: Running Ranorex tests (remotly) using jenkins - fails

Posted: Thu May 11, 2017 8:16 am
by odklizec
OK, why are you starting Ranorex job (manually) from another host computer and not directly from Jenkins master and via Jenkins GUI? There should be no need to do anything manually from another machine, if you configure your Jenkins job properly? But maybe I'm missing something here? ;)

I'm using RDP (connected to slave machine) only to watch the test progress. But everything else is managed by Jenkins master (from build, transfer of artifacts to slave, starting test and collecting results).

Re: Running Ranorex tests (remotly) using jenkins - fails

Posted: Thu May 11, 2017 8:51 am
by yam
I'm running it from Jenkins GUI :-)
Of-course we have jobs that are running automatically over night.
The idea is that everyone can access to Jenkins GUI (url) from his/her computer and run a build/test if needed.

Re: Running Ranorex tests (remotly) using jenkins - fails

Posted: Thu May 11, 2017 9:00 am
by odklizec
OK, so it's the same as in our case. Anyone can access Jenkins GUI via URL and eventually, with appropriate rights, run or manage the tests jobs. But still, it's just a master-slave configuration. So I'm afraid, I'm still not getting why do you access slave machine via RDP/VNC? :) Black screenshots in reports definitely means there is not realized desktop (either locked or test is started with wrong privileges).

Re: Running Ranorex tests (remotly) using jenkins - fails

Posted: Thu May 11, 2017 9:47 am
by yam
I'm opening RDP/VNC just to see that everything works fine and that the computer is not locked (I don't really need to open it :-)).
You've mentioned that maybe test is started with wrong privileges? What do you mean by that? Jenkins job is configured to run the test exe on the slave computer. How can I know if I have privileges to run the test?
Again, as I said, the test is running but fails on UI recognitions (the test, among other things, opens an application and test the UI - I can see that it does not open the app).

I'm sure that I'm missing something here, but I can't figure out what is wrong.

Re: Running Ranorex tests (remotly) using jenkins - fails

Posted: Fri May 12, 2017 1:55 pm
by qwertzu
Hi yam,

I guess odklizec means, you should make sure, that the test is started with admin privileges.
Could you please send us the error message that appears in the Jenkins Console when executing the test?

regards,

qwertzu

Re: Running Ranorex tests (remotly) using jenkins - fails

Posted: Sun May 14, 2017 7:38 am
by yam
My test start with admin privilege.

Here is the error that appears in Jenkins console:
[Error ][Module]: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.