Ranorex failing to complete testing when launched remotely

Ranorex Studio, Spy, Recorder, and Driver.
ChrisG
Posts: 9
Joined: Mon Feb 15, 2016 4:16 pm

Ranorex failing to complete testing when launched remotely

Post by ChrisG » Wed May 18, 2016 9:28 am

Hi all,
So I have managed to setup Ranorex with a run time licence on another machine. I have managed to run a test fine on this machine. We setup Team City to run the tests post build. It takes the following action:
1. Pull the latest Automation files from GIT
2. Run the Ranorex Test Suite.
We followed the steps that were displayed on the blog post (apparently not allowed to post URLs)

However the tests do not seem to run correctly, they fail locating elements but if I RDP into the machine and run the tests, everything is fine. Any suggestions about what we can do to diagnose this issue

Chris

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

Re: Ranorex failing to complete testing when launched remotely

Post by odklizec » Wed May 18, 2016 9:40 am

Hi, could you please post the error message you are getting (in report) while running test via TC (without active Remote Desktop)?

If there is a black screenshot in report, it means that there is not active/unlocked desktop, which is a must for Ranorex to be able to identify GUI elements! This would explain why your tests work fine when RemoteDesktop is active.

If there is just an error regarding the xpath (not found), check the xpath from report and examine if there is such xpath found via Spy. Please post the problematic xpath and Ranorex snapshot (not screenshot) of the app under test, saved on the problematic machine.
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

ChrisG
Posts: 9
Joined: Mon Feb 15, 2016 4:16 pm

Re: Ranorex failing to complete testing when launched remotely

Post by ChrisG » Wed May 18, 2016 12:12 pm

Hi,
01:30.629 Error Module

Failed to find item 'VitalFloRepository.VitalFLO.LoginNoticeNgScope.UserName'.
No element found for path '/dom[@caption='VitalFLO']/body/div[2]/?/?/form[@method='get']/?/?/input[@type='text']' within 1.5m.
Show/Hide Stacktrace


Screenshot

However all the lovely screenshots are showing as black.

ChrisG
Posts: 9
Joined: Mon Feb 15, 2016 4:16 pm

Re: Ranorex failing to complete testing when launched remotely

Post by ChrisG » Wed May 18, 2016 12:15 pm

Hi, what do you mean by active/locked desktop as we launch the tests which are on another machine via Team City. We are not logged into the machine at the time it is invoked via a Team City build step.

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

Re: Ranorex failing to complete testing when launched remotely

Post by odklizec » Wed May 18, 2016 12:28 pm

Hi,

Exactly what I've expected. The black screen means that there is no realized desktop and this is why Ranorex fails to find the elements and why you are getting black screens in report.

Have you followed the part of "Ranorex to TeamCity" integration article, which mentions that "TeamCity Build Agent" service must be disabled and then started via command line?...
http://www.ranorex.com/blog/integrating ... ess/#agent
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

ChrisG
Posts: 9
Joined: Mon Feb 15, 2016 4:16 pm

Re: Ranorex failing to complete testing when launched remotely

Post by ChrisG » Wed May 18, 2016 12:47 pm

I've poked the person who set it up with a stick and we have disabled it running, however we are having issues getting to start not as a windows service. Think a reinstall may be required.

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

Re: Ranorex failing to complete testing when launched remotely

Post by krstcs » Wed May 18, 2016 2:50 pm

In order to run Ranorex tests with a CI system like TeamCity:

1. the agent MUST be run as a local user on the remote system, NOT AS A SERVICE OR AS 'SYSTEM'
2. the system must have a realized desktop (as Pavel said), which means it can't be locked or asleep.

When Windows sleeps or locks the system the desktop is not actually instantiated, so it doesn't actually exist anywhere, so Ranorex can't 'see' it.
Shortcuts usually aren't...