New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Actions drag and drop method #1365
Comments
dragAndDrop you may need to run it 2 times , 1st it will focus on the elements second time it will do drag and drop |
I did what you instructed, and ran it twice but still no drag and drop action was performed. |
having the same problem here. please post the solution here once you find it. |
I've got the same issue here, unable to use the dragAndDrop method nor the clickAndHold + moveToElement + release combination |
I'm having a similar issue using Selenium.WebDriver v2.53.0 and Firefox v45.0.1 using the C# code below. This is moving Backgrid table columns around. Was working in v2.44.0. Anyone experiencing something similar? var actionBuilder = new Actions(Browser);
var dragAction = actionBuilder
.ClickAndHold(columnToDragElement)
.MoveToElement(dragToColumnElement)
.Release()
.Build();
dragAction.Perform(); |
I believe that the issue is related to HTML5. This is a solution that I found so far: http://elementalselenium.com/tips/39-drag-and-drop |
also this is the old original issue logged in google code: |
No auto test because of SeleniumHQ/selenium#1365 Fixes vaadin#4060
No auto test because of SeleniumHQ/selenium#1365 Fixes vaadin#4060
* Properly end HTML5 drag operations when no drop is performed No auto test because of SeleniumHQ/selenium#1365 Fixes #4060
Is there any workaround for moving in coordinates, not to the element? |
Have you tried triggering the mouseMove command twice? That seems to do the trick for me. Although FirefoxDriver works as aspected so my workaround is issuing the move-command twice if a non-firefox driver is detected.
|
What is the status on implementing this in Selenium? |
@ffMathy Do you mean Drag and Drop using the HTML5 drag and drop API or Drag and Drop using a particular JS library? In any case, it's hardly something which has to do with Selenium (the WebDriver client) but rather the browsers interacted with (or in the case of HTML5 DnD the WebDriver protocol standard). |
The same works for me on Chrome 77. Thanks! |
@jasonex7 @llmartinll |
@Wonderio619 What are you trying to do, and what do you mean by 'auto-test execution'? I think I remember a couple of months ago something got changed/fixed so you don't have to issue the move command twice. However, looking at my own code it seems the drag and drop by offset might stil cause problems for chrome. Can you try if something like this works for you?
|
@llmartinll
|
You are using the destination's X,Y coordinates as an offset, that won't work. You would need the difference between the currentPageElement and the targetElement. But, I would use the |
@llmartinll |
Is there any fix to this issue? The drag and drop does not work both on chrome and firefox. i have tried all suggested solutions but nothing works. |
Any news? 😢🤞 |
Apologies for the late reply. I tried to reproduce the original issue and I got the code to work. I pushed the code to this repository in case someone wants to have a look: https://github.com/diemol/selenium-issues/blob/master/selenium/issue-1365/src/test/java/DragAndDropActions.java I also saw that the issue has several comments reporting other different issues. Therefore, if you are still having an issue with the most recent version of Selenium and/or the Selenium 4 Alphas, please create a new issue and provide all the required information. |
org.openqa.selenium.interactions.Actions
When using the above class from the selenium library, the method dragAndDrop(WebElement source, WebElement target) does not work. I have tried executing it multiple times with no luck. Attached is my code to use the drapAndDrop method.
DragAndDropIssue.txt
The text was updated successfully, but these errors were encountered: