Page 1 of 1

Ranorex failing to complete testing when launched remotely

Posted: Wed May 18, 2016 9:28 am
by ChrisG
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

Re: Ranorex failing to complete testing when launched remotely

Posted: Wed May 18, 2016 9:40 am
by odklizec
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.

Re: Ranorex failing to complete testing when launched remotely

Posted: Wed May 18, 2016 12:12 pm
by ChrisG
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.

Re: Ranorex failing to complete testing when launched remotely

Posted: Wed May 18, 2016 12:15 pm
by ChrisG
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.

Re: Ranorex failing to complete testing when launched remotely

Posted: Wed May 18, 2016 12:28 pm
by odklizec
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

Re: Ranorex failing to complete testing when launched remotely

Posted: Wed May 18, 2016 12:47 pm
by ChrisG
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.

Re: Ranorex failing to complete testing when launched remotely

Posted: Wed May 18, 2016 2:50 pm
by krstcs
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.