recorder doesn't find an object when its name changes

Ranorex Studio, Spy, Recorder, and Driver.
ecohen
Posts: 17
Joined: Thu May 09, 2013 10:42 am

recorder doesn't find an object when its name changes

Post by ecohen » Wed May 22, 2013 10:33 am

hi
I recorded a scenario using ranorex
1. click on "new" button and go to "data filters" tab.
2. define new data filter and press "add" button.
3. this action creates a new LINE that represents the data filters creation status.
4. now i want to delete the LINE. this can be done only click on the datafilter name inside the line (link object). if I don't click the link inside the line, then the "delete" button stays disable.
5. during my test case i have to add and remove a lot on those "lines"

the problem:
when i record the click on the data filter name create a new object on my repository:
.//div[#'RadWindowWrapper_ctl00_cphMain_Policy1_rwRule']/table/tbody/tr[2]/td[2]/iframe//a[#'ParameterLink4']
2. mouse click action refers to object named "ParameterLink4".
3. the numbet at the end of the object is changed every line I create. so actually the recorder cannot identify this object so i get "object not found" message...

what are the other options to identify such "slippery" object??
You do not have the required permissions to view the files attached to this post.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: recorder doesn't find an object when its name changes

Post by Support Team » Thu May 23, 2013 4:17 pm

Hello,

You could modify the RxPath of your element in order be robust against such changes (e.g. 'ParameterLink4' instead of ParameterLink3'). One possible way would be to use a regular expression.
Please take a look at the following path:

Code: Select all

.//div[#'RadWindowWrapper_ctl00_cphMain_Policy1_rwRule']/table/tbody/tr[2]/td[2]/iframe//a[id~'ParameterLink']
Another way would be to find another unique attribute.
More information on how to modify RxPath can be found in our User Guide.
Our blog 'Automated Testing and Dynamic IDs' might be useful as well.

Regards,
Markus (T)

ecohen
Posts: 17
Joined: Thu May 09, 2013 10:42 am

Re: recorder doesn't find an object when its name changes

Post by ecohen » Mon May 27, 2013 9:45 am

hi
It seems like more complicated problem.
it's not only the item's name that change every time but also an atribut onthe RxPath:
/dom[@domain='w8-64-14']//div[#'RadWindowWrapper_ctl00_cphMain_Policy1_rwRule']/table/tbody/tr[2]/td[2]/iframe//tr[#'Row1']/td[2]/a[@innertext='Extension']
i couldn't find a way to deal with dynamic path

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: recorder doesn't find an object when its name changes

Post by Support Team » Tue May 28, 2013 4:29 pm

Hello,

Is this newly added line the last line in your table?
If yes, you might be able to select it using the last() method as shown in the path below:
/dom[@domain='w8-64-14']/body/form/div[@id='RadWindowWrapper_ctl00_cphMain_Policy1_rwRule']/table/tbody/tr[last()='True']
We could arrange a remote session in order to assist you.
Could you please send us an email with a suitable time-slot?

Thank you.

Regards,
Markus (T)

ecohen
Posts: 17
Joined: Thu May 09, 2013 10:42 am

Re: recorder doesn't find an object when its name changes

Post by ecohen » Wed May 29, 2013 3:09 pm

hi i fixed the problem.
on the RxPath there were to parameters that were changed dynamicly. i defined both of them as mentioned on your blog and now it's ok