Page 1 of 1

Find Element by ID

Posted: Thu Jul 11, 2013 2:49 pm
by TDCINick
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

Re: Find Element by ID

Posted: Thu Jul 11, 2013 3:11 pm
by krstcs
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']