Page 1 of 1

difference between Adapter.Click and Mouse.Click

Posted: Sat May 06, 2017 4:58 pm
by i.vasilyev
Hello.
Can somebody explain the difference between Adapter.Click and Mouse.Click

Re: difference between Adapter.Click and Mouse.Click

Posted: Mon May 08, 2017 8:01 am
by Stub
I use Adapter.Click to click on an item without worrying about where on the screen that might be. The Location parameter lets me control where on the item I click. The mouse will move to that area - Centre by default - and click on a control.

I tend to use Mouse.Click when I have already positioned the mouse where I want it to do something. e.g. drag/drop, right-click context menus.

Re: difference between Adapter.Click and Mouse.Click

Posted: Tue May 09, 2017 7:21 pm
by ahoisl
Adapter.Click internally calls Mouse.Click for local elements, but additionally does the following 3 things:
  • If you specify a click location, checks whether the location is inside the element bounds and reports a warning if it is not (check may be turned off in settings)
  • Decides whether the underlying element is a local or remote (device/webdriver) element to either call the Mouse.Click or Touch.Tap methods, respectively
  • If it is a local element (Mouse is used), calls EnsureVisible on the element (depending on UseEnsureVisible property)
Mouse.Click just moves the cursor to the specified location and performs a click (that is, itpresses the respective mouse button down and releases it again after a configurable time).
Mouse.Click without passing a location or element just clicks at the current mouse position.

Regards,
Alex
Ranorex Team

Re: difference between Adapter.Click and Mouse.Click

Posted: Wed May 10, 2017 10:08 am
by i.vasilyev
Thanks. Now it is clear enough
ahoisl wrote:Adapter.Click internally calls Mouse.Click for local elements, but additionally does the following 3 things:
  • If you specify a click location, checks whether the location is inside the element bounds and reports a warning if it is not (check may be turned off in settings)
  • Decides whether the underlying element is a local or remote (device/webdriver) element to either call the Mouse.Click or Touch.Tap methods, respectively
  • If it is a local element (Mouse is used), calls EnsureVisible on the element (depending on UseEnsureVisible property)
Mouse.Click just moves the cursor to the specified location and performs a click (that is, itpresses the respective mouse button down and releases it again after a configurable time).
Mouse.Click without passing a location or element just clicks at the current mouse position.

Regards,
Alex
Ranorex Team

Re: difference between Adapter.Click and Mouse.Click

Posted: Fri Aug 25, 2017 3:19 am
by Vijay
Mouse.Click(item) works well on hover / floating items..

If listItem.Click() make the list disappear instead of selecting it, then use Mouse.Click(listItem)

Good for tricky controls such as : @controltypename='ValueListDropDownUnsafe'

Re: difference between Adapter.Click and Mouse.Click

Posted: Sun Aug 27, 2017 7:51 pm
by ahoisl
Vijay wrote:If listItem.Click() make the list disappear instead of selecting it, then use Mouse.Click(listItem)
Just for info: You can also set the "Use Ensure Visible" attribute of a repository item to "False" if you experience that behavior. This should have the same effect as calling Mouse.Click.

Regards,
Alex
Ranorex Team