Control/configure rxpath generate algorithm

Ranorex Studio, Spy, Recorder, and Driver.
Posts: 43
Joined: Fri Dec 30, 2011 10:55 am

Control/configure rxpath generate algorithm

Post by Pavlo » Fri Aug 23, 2013 11:16 am

Hi all

Are there some ways to control/configure rxpath generate algorithm?

I don't know how to explain that better, may be on examples it will most understandable.
Currently generated rxpath:

Code: Select all

What I want to have:

Code: Select all

because there is good chance that developers will rename button from "OK" to "Ok", and I would like to have automation code working well with both options.

Another example:
Currently generated rxpath:

Code: Select all

What I want to have:

Code: Select all

There is only single text element after element[@controlname='txtDealName'], and it has no real meaning in my application.

Main reason why I need that:
Automation project is already 1.5 years old and I was not using recordings, and all items in repositories were added manually. Now, I'm investigating how to delegate part of automation engineer's activities to our clients/customers, and was thinking about start using recordings. And repository items generated during recordings have completely irrelevant names :(
recorder_naming.PNG (24.99 KiB) Viewed 1405 times

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

Re: Control/configure rxpath generate algorithm

Post by Support Team » Tue Aug 27, 2013 8:01 am

Hello Pavlo,

That's a little difficult because the Ranorex Recorder recognizes the controls, which are used and it is not possible to get only the parent element from the control.
For example, if you use the Recorder to type some words into a text box, Ranorex recognizes the text box itself.
I would suggest to use other attributes in order to recognize the elements. The settings for that can be found in the Path weights editor.
Please read the blog "Automated Testing and Dynamic IDs" on our website in order to get more information how to edit path weights.