Mouse Click in Rec module without coordinates and repo item

Ranorex Studio, Spy, Recorder, and Driver.
Aleksei
Posts: 3
Joined: Tue Jan 17, 2017 12:15 pm

Mouse Click in Rec module without coordinates and repo item

Post by Aleksei » Tue Jan 17, 2017 12:24 pm

Hello!
I have an annoying problem.
I need to do moving mouse and clicking actions separately in REC module. So, my mouse pointer is already at the right place by the time I need to perform mouse click. So I want Ranorex to do just left click, without any coordinates and repo item assigned. The reason is that when I assign repo item it searches it for too long. Before, when I just added "empty" click action in recording module it worked OK, but now it always moves the mouse to [0;0] coordinates (top left screen) before clicking.... I know I can do just click with usercode, but it should be possible to do with rec module as well!

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Mouse Click in Rec module without coordinates and repo item

Post by odklizec » Tue Jan 17, 2017 2:04 pm

Hi,

You will have to add User Code action to the recording of your choice and in this action you can use Mouse.Click() method, which performs left click at actual mouse position.

However, in my opinion, you should first solve the problem with long search of repo element item instead of performing a mouse click at "hope-to-be-there" position ;) If Ranorex searches for an element too long, the xpath is most probably too general?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

Aleksei
Posts: 3
Joined: Tue Jan 17, 2017 12:15 pm

Re: Mouse Click in Rec module without coordinates and repo item

Post by Aleksei » Tue Jan 17, 2017 2:08 pm

No, its not. It is just a big complicated flash object with a lot of elements inside elements. I tried to decrease searching time, but i didn't help much. I wonder, how did it work for me before within REC module?Andwhy Ranorex is so big and complicated program, but always missing some few simple things?

jma
Posts: 107
Joined: Fri Jul 03, 2015 9:18 am

Re: Mouse Click in Rec module without coordinates and repo item

Post by jma » Thu Jan 19, 2017 3:52 pm

Hi Aleksei,

Decreasing the search timeout doesn't improve the speed of object recognition. This timeout defines the maximum time to search for the specified element. If the timeout value is too low, Ranorex probably has too less time to find the UI element.

I would suggest uploading the snapshot of the corresponding element and posting your current RanoreXPath to the forum. Then, we could have a look at your specific path.
Information about creating a snapshot can be found on the Ranorex web page: http://www.ranorex.com/support/user-gui ... pshot.html

Generally, I'd recommend having a detailed look at the user guide section about the RanoreXPath: http://www.ranorex.com/support/user-gui ... xpath.html

Aleksei
Posts: 3
Joined: Tue Jan 17, 2017 12:15 pm

Re: Mouse Click in Rec module without coordinates and repo item

Post by Aleksei » Fri Jan 20, 2017 12:03 pm

Hi jma,
thanks, but I didn't say I tried to decrease search timeOUT, but searching time (i. e. optimizing it)
I will try different things and guides, thanks.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Mouse Click in Rec module without coordinates and repo item

Post by odklizec » Fri Jan 20, 2017 12:49 pm

Any chance you can post a Ranorex snapshot of the problematic element and a sample xpath you are currently using? Maybe we can suggest some improvements? Basically, you should avoid using optional '?' characters, because they can make the search really long. Use them only in specific cases. Also, too general xpath, with a lot of skipped elements can significantly increase the search time.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration