Page 1 of 1

Control/configure rxpath generate algorithm

Posted: Fri Aug 23, 2013 11:16 am
by Pavlo
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 :(

Re: Control/configure rxpath generate algorithm

Posted: Tue Aug 27, 2013 8:01 am
by Support Team
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