Test run Failure when executing remotely via Jenkins

Ranorex Spy, Recorder, and Studio.
Posts: 5
Joined: Wed Dec 18, 2019 3:41 am

Test run Failure when executing remotely via Jenkins

Post by paul.simkin » Thu Mar 05, 2020 4:18 am

Hi - Recently purchased and implemented Ranorex for an aging Delphi medical platform - very impressed and satisfied with results so far.

I've integrated the test execution process with Jenkins and git - but have run into a problem with the remote execution and was hoping to ask for some guidance here in the forums, which seem very active and helpful. Apologies in advance for the length of my post.

When the Jenkins job is run
- the solution is built from git and is deposited correctly into the local jenkins output folder with the correct executable, rxtst file and required runtime files.
- the jenkins job has a build step (from the Ranorex plug in) - where it Runs the test suite.rxtst file: eg ./.../bin/debug/TestSuiteName.rstxt file.
- the test suite is correctly launched from jenkins and executes the first few steps of the login test case - it correctly identifies the initial login screen objects, performs a basic select on an ok button
- but then it fails to recognise the objects on the second part of the login window and the test run ends.
- the entire test suite runs fine without error when run locally - so its not the test failing to find the object itself - all the required processes are whitelisted correctly.

Based on reading the forums and stackoverflow, suspect it is due to Ranorex not working when called by a service:
- given that Jenkins is on a different server to Ranorex, I've used a slave node running as a service on the box where Ranorex is installed
- however, what makes me puzzled about this is several things
1) I wouldn't expect the test to run at all ? EG it would just fail outright, and not run a few tests ok and THEN fail ?
2) I WAS getting errors on test execution from jenkins with msg "This operation requires an interactive window station". I addressed this by setting the checkbox for "Show progress dialog" to false on the test suite properties pane, and then the test would at least run the first few steps before failing as above.
3) I have tried replacing the Run Ranorex test build step in Jenkins (that calls the rxtst file directly) with a build step that calls a bat file on the Ranorex Server that runs the testsuite executable - with the same results as the main error: it runs the first steps of the first test and then fails with the same object recognition error.

From my reading, it looks like using a ranorex agent is the typical remedy- however, as i am targeting the same machine where Ranorex Studio itself is installed this seems a bit weird/redundant ?

Details of the test framework and jenkins jobs.
- ranorex 9.20 is installed to a windows 2016 server (server A) with a single floating licence. Tests are created and stored here on this same server and run fine from here.
- Source control is git
- CI/CD infrastruture: jenkins is on another server with a slave node installed on the server where Ranorex Studio is
- see below for screenshots of the jenkins configuration and the console output.
JenkinsConsoleOutput_2.jpg (263.24 KiB) Viewed 169 times
JenkinsConsoleOutput_1.jpg (128.78 KiB) Viewed 169 times
JenkinsJobSettings_BuildStepsjpg.jpg (71.7 KiB) Viewed 169 times

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

Re: Test run Failure when executing remotely via Jenkins

Post by odklizec » Thu Mar 05, 2020 8:32 am


At first, please update Ranorex with at least 9.2.1. There was a number of bug fixes introduced in 9.2.1. They may not affect your situation, but one never knows.

At next, if I understand the problem correctly, the test runs fine, on the very same machine, if the test is started from Studio?

Could you please add Create Snapshot action, right before the typically failing step? Just point it to the parent dialog, which contains the failing element. In my opinion, the xpath is most probably different and this is why it fails. The snapshot, created during test, should tell us what's wrong ;)
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

Posts: 5
Joined: Wed Dec 18, 2019 3:41 am

Re: Test run Failure when executing remotely via Jenkins

Post by paul.simkin » Tue Mar 10, 2020 7:48 am


Thanks for the quick reply. Quick summary
- I upgraded to 9.3.0 - still had the issue.
- I installed a Ranorex agent on the same server as Ranorex Studio: and created a bat file to run the desired test suite on the agent.
- added a build step to call this bat file
- Now Jenkins will execute the tests remotely without problem (which means it is not an xpath issue) provided the GUI is still available in an active session.

Trying solutions suggested here such as VNC and Logonexport etc.