How do i make the scripts co ordinates independent...
eg: when the item is clicked it generates the coordinates like 142;54 and next time I run it the it fails to click at the area with specified coordinates value.
Making the script coordinates independent
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Making the script coordinates independent
Ranorex uses coordinates for relative positions inside UI elements only. That means, when doing a mouse click on an item, we search for a UI element by its RanoreXPath. Ranorex then gets the screen position from the item and uses the coordinates only to further specify the click position relative to the element bounds.
You can change the recorder settings (see http://www.ranorex.com/support/user-gui ... ation.html) to not record relative mouse coordinates ("Record relative element coordinates" setting). That way Ranorex will always click right at the center of the UI element. However, that won't work for all controls, e.g. when some control is only recognized as one big element and you need to click at a defined location inside that element.
It all comes down to how small the elements are that Ranorex can identify by RanoreXPath. You can easily check that by turning on the "Highlight Elements" option (see http://www.ranorex.com/support/user-gui ... html#c2568) in Ranorex Spy. The smaller the elements are, the more coordinate independent your scripts will be.
As an alternative you can use Image Based automation to specify where to click inside an element (see http://www.ranorex.com/support/user-gui ... ation.html).
Regards,
Alex
Ranorex Support Team
You can change the recorder settings (see http://www.ranorex.com/support/user-gui ... ation.html) to not record relative mouse coordinates ("Record relative element coordinates" setting). That way Ranorex will always click right at the center of the UI element. However, that won't work for all controls, e.g. when some control is only recognized as one big element and you need to click at a defined location inside that element.
It all comes down to how small the elements are that Ranorex can identify by RanoreXPath. You can easily check that by turning on the "Highlight Elements" option (see http://www.ranorex.com/support/user-gui ... html#c2568) in Ranorex Spy. The smaller the elements are, the more coordinate independent your scripts will be.
As an alternative you can use Image Based automation to specify where to click inside an element (see http://www.ranorex.com/support/user-gui ... ation.html).
Regards,
Alex
Ranorex Support Team