GUI element not found when test stated from command line

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
melodican
Posts: 37
Joined: Fri Nov 04, 2016 12:50 pm

GUI element not found when test stated from command line

Post by melodican » Mon Oct 29, 2018 2:29 pm

I have the following problem:
In the SUT to test there is a menu item to start the windows task manager. To test this functionality I have recorded a tests which is using the menu item, validates the existence of the the task manager and closes the task manager. This tests works if started from Ranorex studio. But if I execute the same test from the command line, the task manager is not found during the validation step and the GUI elements of the task manager are not found.

Any idea why the tests fails if started from the command line but works if started from Ranorex studio (Version 8.3.0)?

Kind regards,
Hans-Georg

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

Re: GUI element not found when test stated from command line

Post by odklizec » Mon Oct 29, 2018 2:36 pm

Hi,

Could you please post the exact error you are getting? Also, what is the xpath behind the recorded repo item?

My guess is it's either a permission issue or the xpath is simply different? Unfortunately, it's hard to tell what's wrong, without seeing the xpath and snapshot (NOT screenshot) of the problematic element. Plus it would be very helpful to see the exact steps you are trying to perform (screenshot of recording should be fine).

BTW, are you running the test from a local drive? Ranorex does not support running tests from network/shared drives!
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

melodican
Posts: 37
Joined: Fri Nov 04, 2016 12:50 pm

Re: GUI element not found when test stated from command line

Post by melodican » Mon Oct 29, 2018 3:42 pm

Thank you for your quick response!
I'm running the test from a local drive.

My test is using a menu to start the Task Manager
followed by a validation to check that the Task Manager has started.
Afterwards the Task Manaher is closed by clicking on the (X).

It woks perfectly when executing the test from the Ranore studio, but when executing the tests by starting the test from the command line the validation fails. This message is diaplyed:
Attribute 'Title' of element for item 'CHIRplus_FX_Sanity_ChecksRepository.TaskManager.Self' does not match the specified value (Failed to find item 'CHIRplus_FX_Sanity_ChecksRepository.TaskManager.Self'. No element found for path '/form[@name='Task Manager' or @title='Windows Task-Manager']' within 30s.).

I have attached the snapshot of the Task Managers (X). I guess it has to do something with the permissions (adminsitartive rights?).

I'm also trying to attach screenshots of the steps desribed eralier but for some reasons the screenshots disappear after I use "Preview".
You do not have the required permissions to view the files attached to this post.

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

Re: GUI element not found when test stated from command line

Post by odklizec » Mon Oct 29, 2018 3:51 pm

As I suspected, it appears to be a permission issue. The snapshot you provided immediately complaints about permissions.
permission.png
Please follow the steps mentioned in User Guide:
https://www.ranorex.com/help/latest/int ... plications
Are you starting the test as Administrator? Just create a shortcut (for batch file) and set it to run as Administrator.
You do not have the required permissions to view the files attached to this post.
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

melodican
Posts: 37
Joined: Fri Nov 04, 2016 12:50 pm

Re: GUI element not found when test stated from command line

Post by melodican » Tue Oct 30, 2018 8:32 am

Thank you for your answer! It helped me a lot to solve the issue.

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

Re: GUI element not found when test stated from command line

Post by odklizec » Tue Oct 30, 2018 8:44 am

Hi,

You are welcome. I'm glad I could help ;)
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