Action spot outside the area of repo element?

Ask general questions here.
dugovic.milan
Posts: 41
Joined: Wed Jun 29, 2016 1:19 pm
Location: Frankfurt, Germany
Contact:

Action spot outside the area of repo element?

Post by dugovic.milan » Thu Feb 16, 2017 10:25 am

Hey... does anyone know how to click few pixels in any direction outside the area of graphic element? Or how to use Click/Move action (against no repo element) with respect to the previous step and not to the whole screen resolution? Any ideas? Thanks...
Ranorex 8.3.0

User avatar
Stub
Posts: 173
Joined: Fri Jul 15, 2016 1:35 pm

Re: Action spot outside the area of repo element?

Post by Stub » Thu Feb 16, 2017 12:35 pm

I've been clicking to the left of a treeitem to check a box:

Code: Select all

Ranorex.TreeItem treeitem
treeitem.Click(new Location(-25, treeitem.Element.Size.Height / 2));
I'll need to calculate that offset value at some point but that's working for me at the moment.

My mouse moves have always been calculated in terms of an element with a screen rectangle however. Haven't done any mouse movements relative to where it is currently located.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Action spot outside the area of repo element?

Post by Support Team » Fri Feb 17, 2017 2:19 pm

Hi dugovic.milan,

A coordinate-based mouse click can be performed relative to any UI element. First, I would suggest tracking the UI element, which you want to use for the relative click action. After tracking the element, you can move the mouse to the actual action spot of the click. In Ranorex Spy you will see the coordinates relative to the current element.
mouse_coordinates.png
mouse_coordinates.png (2.28 KiB) Viewed 998 times
Those coordinates can be used as the action spot for the click action.
mouse_click_action.png
mouse_click_action.png (3.33 KiB) Viewed 998 times
As a consequence, the mouse click is performed outside of the UI element relative to this element.
mouse_click.png
mouse_click.png (1.73 KiB) Viewed 998 times
I hope this information will help you.

Sincerely,
Johannes
.
Image