On the fly object recognition

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
alans
Posts: 1
Joined: Wed May 06, 2015 12:50 pm

On the fly object recognition

Post by alans » Thu May 07, 2015 8:48 am

Hi all....

I'm wondering it it is possible to identify object and return it's xpath on the fly.

Example: I have a windows application. There is element let's say "Home" [Button]. I know that this element has accessible_description something like "btn_home_main".

It is possible to do something like (pseudo code)

I start application

Find application handle/main window [No idea how]
x = Find First element *[@AccessibleDescription="btn_home_main"] [No idea how]
Click Element x

Maybe implement something like Find Element And Click *[@AccessibleDescription="btn_home_main"]


I would by like to find out both this solutions.
1) Find first element, that match and return xpath
2) Click on first element that match


Is something like this possible to do with ranorex API?


Thanks

User avatar
RobinHood42
Posts: 240
Joined: Fri Jan 09, 2015 3:24 pm

Re: On the fly object recognition

Post by RobinHood42 » Wed May 13, 2015 8:58 am

Hi alans,

In general, Ranorex recognizes elements and uses the so-called RxPath to map elements to the repository. There is no way to shorten the process of recognizing elements. I’m afraid that I’m not exactly sure what you want to achieve, but I don’t think there is the possibility to do so. Maybe you should reconsider your plans and test scenario.

Cheers,
Robin

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

Re: On the fly object recognition

Post by krstcs » Wed May 13, 2015 1:49 pm

Without knowing what your intention is, I would agree with Robin.

Ranorex uses XPath exclusively to recognize UI elements. There is no getting around that.

If you are wanting to know how to make the XPath dynamic, then you should read the user guide, it will tell you everything you need to know. http://www.ranorex.com/support/user-guide-20.html
Shortcuts usually aren't...