Testing Fails because

Ranorex Spy, Recorder, and Studio.
ahmedwaheed
Posts: 2
Joined: Tue May 15, 2018 9:25 am

Testing Fails because

Post by ahmedwaheed » Tue May 15, 2018 1:28 pm

I am recording test for IBM Rational Rhapsody
When I Run the test it fails as it can not find an item although it exists, I checked and found out that the parent form of the element changes its ID each time, as in the attached snapshot (target item is "Tree 6131" and it is inside a the highlighted form whose id is variable)

How can I overcome this problem?
Attachments
modeltree_id_ranorex.PNG
modeltree_id_ranorex.PNG (71.67 KiB) Viewed 208 times

qwertzu
Posts: 179
Joined: Wed Jan 25, 2017 11:08 am

Re: Testing Fails because

Post by qwertzu » Wed May 16, 2018 9:23 am

Hi Ahmed,
If the id of the parent form doesn't remain the same, you should rather use some other attribute in the path to your element.
Maybe you can find an attribute which doesn't change.
Detailed information about adapting paths can be found here: https://www.ranorex.com/help/latest/ranorexpath
regards, qwertzu

User avatar
Stub
Posts: 173
Joined: Fri Jul 15, 2016 1:35 pm

Re: Testing Fails because

Post by Stub » Wed May 16, 2018 9:25 am

I try to pick something unique about a form or control which doesn't change over time, in order to identify it. For us, control IDs fluctuate for various reasons. I've lately taken to setting an unused and unseen control label so I can easily identify the control/form/table that I'm after. I know absolutely nothing about this Rational Rhapsody though.

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

Re: Testing Fails because

Post by odklizec » Thu May 17, 2018 7:41 am

Hi,

Just an additional note. I would suggest to read below blog post, describing how to work with dynamic IDs and how to set Ranorex xpath weight, to prefer different than default attributes...
https://www.ranorex.com/blog/automated- ... namic-ids/
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