Page 1 of 1

YUI Library

Posted: Wed Oct 24, 2012 1:41 pm
by JoeR
We use the YUI library in our web development. Because of that there are component IDs created "on the fly" and are not always the same for each component when it is loaded. What is the best practice for dealing with those changing IDs? Ranorex by default uses those IDs to resolve the components. When that happens those components cannot always be found when the scripts are ran multiple times. Any help would be appreciated.

Joe

Re: YUI Library

Posted: Wed Oct 24, 2012 2:44 pm
by Support Team
Hello Joe,

Is there another way to uniquely identify those elements via property?
You could disable 'Enable search by unique ID' in the global settings.

Additionally information can be found in section RanoreXPath in our user guide.

Regards,
Markus (T)
Ranorex Support Team

Re: YUI Library

Posted: Mon Oct 29, 2012 7:28 pm
by krstcs
Joe,

Most UI elements that provide functionality to the user have textual or iconic representations that can be uniquely identified.

On thing I have had to do is look at child text elements of the button (for example) that I am looking for.

So my buttons might be:
\container\button[@id='1234']
\container\button[@id='1235']

The first one is the 'OK' button, the second is the 'Cancel' button.

The text is actually in a text child element of the buttons, like so:

\container\button[@id='1234']\text[@value='OK']
\container\button[@id='1235]\text[@value='Cancel']

The problem is that you may need to perform a click on the button, but can't find it without the label.

So you can do this:

\container\button\text[@value='OK']\parent::button
\container\button\text[@value='Cancel']\parent::button

These relational labels in the RxPath will help you get around a lot of issues with unique identification.

Hope this helps!