Get RxPath during Test Runtime

Ranorex Spy, Recorder, and Studio.
semate
Posts: 13
Joined: Tue Jul 03, 2018 7:42 am

Get RxPath during Test Runtime

Post by semate » Wed Feb 13, 2019 4:23 pm

Hi there!

Is it possible to find out the RxPath of an object by clicking on it (or hovering) during runtime(!) of the test?
Basically using the Spy functionallity while the test is executing.

ahoisl
Certified Professional
Certified Professional
Posts: 175
Joined: Fri Sep 07, 2007 8:16 am

Re: Get RxPath during Test Runtime

Post by ahoisl » Wed Feb 13, 2019 9:05 pm

Ranorex adapters/elements provide the GetPath method which will calculate and return a RanoreXPath for the element that is unique at the time of calling the method.

If you want to get an element from a specific point on the screen, you can use the Element.FindFromPoint method. As the API documentation says, it will require a Premium license, though, even if you call it in your test execution:
var elementAtScreenLocation = Host.Local.Element.FindFromPoint(new Point(123, 456));
Regards,
Alex
Ranorex Team