[Question]: How to drag and drop an element by offset
See original GitHub issueYour question
Is there a way to drag and drop an element by offset with playwright? Something similar to this:
drag_and_drop_by_offset(source, x_offset, y_offset)
.
The page.drag_and_drop(source, target, **kwargs)
(doc) method of playwright seems it can drag a source element into a target element. But how can I drag an element by offset?
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to Perform Drag and Drop Offset Method in Selenium ...
This method is to click and hold the web element in the source location and then release the mouse in the specified location....
Read more >How to Drag and Drop in Selenium WebDriver (EXAMPLE)
Scenario 1: BANK element is dragged and dropped on the specific cell by DragAndDrop method. In the following code, we launch the given...
Read more >How to Drag and Drop in Selenium using Action ... - Tools QA
dragAndDropBy(WebElement source, int xOffset, int yOffset): This method clicks & holds the source element and moves by a given offset, then ...
Read more >Protractor dragAndDrop by offset Location of Element
The way you can edit start location is through the mouseMove() method though, shown in one of my other questions here. It is...
Read more >How to do the basic Drag and Drop action - TestProject Forum
First I will freeze the element I want to drag and I will use the action “Angular drag and drop”:.
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
Actually I have managed to do this by combining
page.mouse.move()
,page.mouse.down()
andpage.mouse.up()
methods. The code to achieve this is as follows:It did the job, could seem a bit redundant though.
You can also do this:
It will drag an element with an yOffset of 80