YUI Library

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
JoeR
Posts: 32
Joined: Fri Dec 03, 2010 6:15 pm
Location: Morrisville, NC
Contact:

YUI Library

Post by JoeR » Wed Oct 24, 2012 1:41 pm

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

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

Re: YUI Library

Post by Support Team » Wed Oct 24, 2012 2:44 pm

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
.
Image

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: YUI Library

Post by krstcs » Mon Oct 29, 2012 7:28 pm

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!
Shortcuts usually aren't...