Find Element by ID

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
TDCINick
Posts: 7
Joined: Tue Feb 05, 2013 6:26 pm

Find Element by ID

Post by TDCINick » Thu Jul 11, 2013 2:49 pm

Hello, I want to know if there is a way to locate elements by the ID value on the element. With our new version most of the functionality has not changed but the UI has changed somewhat. Because of the change the xpath changed but the Unique ID is the same. Maybe a wildcard for the element type or something that just searches for the ID of an element. I could not find anything like this on the forum or the user guide.

Here is an example of the new UI vs old UI xpath of a button.

/dom[@domain='localhost']//button[#'RunInteractive']
/dom[@domain='localhost']//input[#'RunInteractive']

Thanks

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

Re: Find Element by ID

Post by krstcs » Thu Jul 11, 2013 3:11 pm

Without knowing the type of object (Button, Input, etc.) Ranorex would not know what adapter to use, and therefore it wouldn't know what capabilities were available. It would not know what things could be done TO the object and what attributes the object should have.

You can just set all your repository items to "element", but that is the generic adapter and would not have implementation specific capabilities.

edit to add:

So in your example:

/dom[@domain='localhost']//button[#'RunInteractive']
/dom[@domain='localhost']//input[#'RunInteractive']

would be:
/dom[@domain='localhost']//element[#'RunInteractive']
Shortcuts usually aren't...