Hello.
Can somebody explain the difference between Adapter.Click and Mouse.Click
difference between Adapter.Click and Mouse.Click
-
- Posts: 30
- Joined: Fri Sep 09, 2016 10:14 am
Re: difference between Adapter.Click and Mouse.Click
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.
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
Adapter.Click internally calls Mouse.Click for local elements, but additionally does the following 3 things:
Mouse.Click without passing a location or element just clicks at the current mouse position.
Regards,
Alex
Ranorex Team
- 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 without passing a location or element just clicks at the current mouse position.
Regards,
Alex
Ranorex Team
-
- Posts: 30
- Joined: Fri Sep 09, 2016 10:14 am
Re: difference between Adapter.Click and Mouse.Click
Thanks. Now it is clear enough
ahoisl wrote:Adapter.Click internally calls Mouse.Click for local elements, but additionally does the following 3 things:
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).
- 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 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
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'
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
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.Vijay wrote:If listItem.Click() make the list disappear instead of selecting it, then use Mouse.Click(listItem)
Regards,
Alex
Ranorex Team