Hi.
I have some test cases that do not use any UI and then a few that do use UI. When I run the tests from the machine, either through ranorex studio or simply double clicking the .exe that is generated, then everything runs fine. Then when I use TeamCity to build the code from BitBucket, deploy it to the test machine, and eventually run the .exe file then the UI tests fail with a message saying that the UI element was not found.
Is there some limitation when using TeamCity to run UI tests?
UI tests fail when run from TeamCity
Re: UI tests fail when run from TeamCity
Hi,
Are you sure the test exe is started with enough privileges (administrator)?
Are you sure the TeamCity agent is started as standard windows user and not as service? In case you see black screenshots in report in report, exe is not started as standard windows user.
Have you tried to start (manually) the exe file deployed by TeamCity?
Also, make sure the Ranorex settings are the same on both local and team city VM! Different settings are most common cause of different results
Are you sure the test exe is started with enough privileges (administrator)?
Are you sure the TeamCity agent is started as standard windows user and not as service? In case you see black screenshots in report in report, exe is not started as standard windows user.
Have you tried to start (manually) the exe file deployed by TeamCity?
Also, make sure the Ranorex settings are the same on both local and team city VM! Different settings are most common cause of different results

Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: UI tests fail when run from TeamCity
I have successfully manually started the .exe file and that works fine.
The screenshots are just blank so maybe the issue is with the agent being started as a service. I will change that and see if that fixes it.
The screenshots are just blank so maybe the issue is with the agent being started as a service. I will change that and see if that fixes it.
Re: UI tests fail when run from TeamCity
I have changed the service to use an elevated user account but it still just shows blank screenshots and fails with this error: "Failed to find item 'KeyingClientAutoTestsRepository.AuthenticationForm.Username'.
No element found for path '/form[@controlname='AuthenticationForm']/container[@controlname='_groupLogin']//text[@accessiblename='Username:']' within 1m. "
No element found for path '/form[@controlname='AuthenticationForm']/container[@controlname='_groupLogin']//text[@accessiblename='Username:']' within 1m. "
Re: UI tests fail when run from TeamCity
Hi,
Blank screenshot means, that the test has no access to UI. In other words, the TeamCity agent is most probably still running as a service. Are you sure you followed the steps for Team City Build agent?...
https://www.ranorex.com/blog/integratin ... ess/#agent
Blank screenshot means, that the test has no access to UI. In other words, the TeamCity agent is most probably still running as a service. Are you sure you followed the steps for Team City Build agent?...
https://www.ranorex.com/blog/integratin ... ess/#agent
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: UI tests fail when run from TeamCity
Yeah. I do exactly like it says on that webpage.
I run it in administrator mode and start it myself using "agent start" but still it has the screenshots blank.
Also. When I am logged in myself and run the tests from TeamCity then it works pretty well. I simply keep the session open and do nothing.
But if I log out of the auto test server and run the tests from TeamCity then it fails with an error indicating "Failed to find item 'KeyingClientAutoTestsRepository.KeyingForm.Tabs.Text'.
No element found for path 'tabpagelist[@controlname='tabs']/tabpage[@controlname='keyingPageTab']/container[@controlname='mainPanel']/element[@controlname='ControlStack']/?/?/element[@controlname='ControlStack']//text[@accessiblerole='Text']' within 1m. "
I run it in administrator mode and start it myself using "agent start" but still it has the screenshots blank.
Also. When I am logged in myself and run the tests from TeamCity then it works pretty well. I simply keep the session open and do nothing.
But if I log out of the auto test server and run the tests from TeamCity then it fails with an error indicating "Failed to find item 'KeyingClientAutoTestsRepository.KeyingForm.Tabs.Text'.
No element found for path 'tabpagelist[@controlname='tabs']/tabpage[@controlname='keyingPageTab']/container[@controlname='mainPanel']/element[@controlname='ControlStack']/?/?/element[@controlname='ControlStack']//text[@accessiblerole='Text']' within 1m. "
Re: UI tests fail when run from TeamCity
Ah yes, you must keep the session open! Ranorex cannot work with closed session. Closing or even minimizing remote desktop kills the session. Check for example this post, with some suggestions how to keep the session open... https://www.ranorex.com/forum/ranorex-s ... tml#p40652
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: UI tests fail when run from TeamCity
Absolutely right.
I managed to use tscon.exe to achive what I wanted.
Thanks.
I managed to use tscon.exe to achive what I wanted.
Thanks.