Extension of keyword Drag And Drop By Coordinates: make release of the mouse button flexible
See original GitHub issueSo far the keyword “Drag And Drop By Coordinates” does the following:
First it moves the mouse to the start-point,
then presses the left mouse button,
then moves to the end-point in specified number of steps,
then releases the mouse button.
I’d suggest to add a boolean parameter “release” which controls whether the mouse button at the end is released or not.
The default value would be True so that nothing would change for existing calls of the keyword.
The extended keyword used in sequence allows to drag the mouse several times to different coordinates before the mouse button is released.
This would allow a more realistic simulation of user interaction.
And it would allow to test GUI elements that react permanently on the position of the mouse like virtual joysticks.
Suggestion to Browser/keywords/interaction.py, not tested yet:
OLD:
def drag_and_drop_by_coordinates(
self, from_x: float, from_y: float, to_x: float, to_y: float, steps: int = 1
): ...
self.mouse_button(MouseButtonAction.down, x=from_x, y=from_y)
self.mouse_move(x=to_x, y=to_y, steps=steps)
self.mouse_button(MouseButtonAction.up)
NEW:
def drag_and_drop_by_coordinates(
self, from_x: float, from_y: float, to_x: float, to_y: float, steps: int = 1, release: bool = True
): ...
self.mouse_button(MouseButtonAction.down, x=from_x, y=from_y)
self.mouse_move(x=to_x, y=to_y, steps=steps)
if release:
self.mouse_button(MouseButtonAction.up)
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
coordinates
Adds a mouse position tooltip, with its x and y coordinates. Also measures areas of regions. Note local files: In the extension details...
Read more >Chapter 18 - Automate the Boring Stuff with Python
At a high level, here's what your program should do: Display the current x- and y-coordinates of the mouse cursor. Update these coordinates...
Read more >cursor - CSS: Cascading Style Sheets - MDN Web Docs
The cursor CSS property sets the mouse cursor, if any, to show when the mouse pointer is over an element.
Read more >[WebUI] Click Offset - Katalon Docs
Click on the given element with the relative position (x, y) from the in-view center point of that element. ... import com.kms.katalon.core.webui.keyword.
Read more >Auto clicker chrome os
You can input more than one coordinate pair and make the auto clicker run in ... Mouse Click Every Minute, Second or Milli...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Agree. Thanks for that hint, just in time. If there aren’t any objections I am going to implement it next week with
no_dropargument.Done in #1799