Control/configure rxpath generate algorithm

Ranorex Spy, Recorder, and Studio.
Pavlo
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.
So:
Currently generated rxpath:

Code: Select all

/form[@controlname='DealDetails']/container[@controlname='panelButtons']/element[@controlname='btnOk']/button[@accessiblename='&OK']
What I want to have:

Code: Select all

/form[@controlname='DealDetails']/container[@controlname='panelButtons']/element[@controlname='btnOk']/button
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

form[@controlname='DealDetails']/container[@controlname='panelClient']/container[@controlname='grpDealDetails']/element[@controlname='txtDealName']/text[@controltypename='TextBoxMaskBox']
What I want to have:

Code: Select all

form[@controlname='DealDetails']/container[@controlname='panelClient']/container[@controlname='grpDealDetails']/element[@controlname='txtDealName']
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 :(
Attachments
recorder_naming.PNG
recorder_naming.PNG (24.99 KiB) Viewed 851 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

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.

Regards,
Bernhard
.
Image