Jenkins does not open Browser upon executing a Ranorex Test

Ask general questions here.
Sarah
Posts: 6
Joined: Tue Mar 05, 2019 9:07 am

Jenkins does not open Browser upon executing a Ranorex Test

Post by Sarah » Wed Mar 06, 2019 10:36 am

Hi,

I currently have the following problem:

I have a Ranorex Test Suite consisting of one test case. This test case should open a specific web page with Chrome and then perform some actions on that page.
If I start the test from Ranorex itself, everything is working fine. Same if I start the genereated exe File.

After having this test I did set up a build process on Jenkins, which should execute the Test. I have currently two processes:
  • One process just has a "execute windows batch file" step in it and is calling the generated exe File
  • The other process is calling my whole test suite by using the ranorex plugin.
No matter which of the both processes I call, I always encounter the same problem: The browser (the first step in my test) does not open at all.

I encounter this problem on a windows server, as well as on a windows client (windows 10). But with one difference: If I run the jenkins process on the server, I am afterwards not even able to open Chrome manually, I have to restart the server to do anything at all. At my client I am afterwards at least able to open Chrome manually without any restart.

Did somebody maybe encounter the same or similar problems? And what would you recommend as a solution?

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

Re: Jenkins does not open Browser upon executing a Ranorex Test

Post by odklizec » Wed Mar 06, 2019 12:24 pm

Hi,

I'm using Jenkins and Ranorex for a very long time (with both desktop and server Windows) and I've never experienced issue like this? So my guess is, that it's either caused by incorrect Jenkins setup, corrupted Chrome setup or some kind of restriction implemented by your IT? Please answer below questions:

Is there an error saved in Ranorex report (after the test fails)?
Are you using Jenkins with master/slave configuration (i.e. VM with Jenkins Master and VM with Jenkins Slave, where the test is actually running)?
Are you sure that Jenkins is not started as a service? This is very important, because if Jenkins is started as a service, then the Chrome is most probably running, just not in UI mode! And this is why you don't see it. Jenkins must NOT be started as a service! ;)
And finally, have you tried to run your test with different browser (e.g. IE or FF)?
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

Sarah
Posts: 6
Joined: Tue Mar 05, 2019 9:07 am

Re: Jenkins does not open Browser upon executing a Ranorex Test

Post by Sarah » Thu Mar 07, 2019 8:02 am

Hi,

Yes, there is a saved Report, with all black screenshots in it. Therefore we also have been thinking about the UI mode. And yes, Jenkins is running as a service. Meanwhile I tried to start jenkins manually on my machine, and doing so the test runs through.

So the solution is really, that we don't start Jenkins as a service? I have to admit that I somehow do not like that solution.

Currently we are not running on a Master-Slave setup (because the Administrator of the Master is sick :?) - but we plan to change that. Is there something we have to think about if doing so?

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

Re: Jenkins does not open Browser upon executing a Ranorex Test

Post by odklizec » Thu Mar 07, 2019 8:35 am

Hi,

Black screens in report are the best indication that the test has not been run in UI mode. This limitation about not running Jenkins as a service is not a Ranorex limitation but general limitation for all UI-based test automation tools. Simply, service mode does not offer the same level of rights as normal user. and mainly, access to desktop. And apps started from service mode runs in service mode as well :) Therefore, there is no UI available = black screens ;)

As for master-slave configuration, I believe you can easily leave master running as a service (if you prefer that), but all slaves must be started from command line. In this case, the tests will be not run on master, but on slaves, hence slaves need access to UI. When I'm configuring new slave, I follow this guide:
https://wiki.jenkins.io/pages/viewpage. ... d=75893612
Then once the slave is installed and started as a service, I go to service manager, disable Jenkins slave service and then in Jenkins directory (created by slave installation steps), add a CMD file with command line, copied from jenkins-slave.xml. Hope this helps.
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