Skip to content

Drag and drop issue on native events #9860

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

Closed
vduhautois opened this issue Sep 21, 2021 · 3 comments
Closed

Drag and drop issue on native events #9860

vduhautois opened this issue Sep 21, 2021 · 3 comments
Labels
G-w3c Requires change to W3C Spec

Comments

@vduhautois
Copy link

vduhautois commented Sep 21, 2021

🐛 Bug Report

I try to automate tests on a drag and drop feature.
I can't perform the drag and drop, the mouse is never released (and the target coordinates seems to be wrong)

I test this code with selenium 3.141.59 and selenium 4.0.0-rc-1, on the last stable chrome version.

Details: I already automate drag and drop feature testing without any issue. The difference seems to be here, the drag and drop is native, there is no external lib used to performed the drag and drop.

So I post you an exemple with the drag and drop on a w3schools page, with a completely simple code.

To Reproduce

        @Test
	public void testDragNDrop() throws InterruptedException {
		// loading driver with io.github.bonigarcia.webdrivermanager
		WebDriverManager.chromedriver().setup();
		// new Chrome driver
		final ChromeDriver driver = new ChromeDriver();
		// navigate to url
		driver.navigate().to("https://www.w3schools.com/html/html5_draganddrop.asp");
		// accept cookies
		driver.findElement(By.cssSelector("#accept-choices")).click();

		// sourceElt: img to drag and drop
		final WebElement sourceElt = driver.findElement(By.cssSelector("div#div1 > img#drag1"));
		// targetElt: div to drop the img
		final WebElement targetElt = driver.findElement(By.cssSelector("div#div2"));

		// use Actions API to drag and drop
		new Actions(driver)
		        .pause(500)
		        .dragAndDrop(sourceElt, targetElt)
		        .pause(500)
		        .perform();

		// a wait to see the result before end the test
		TimeUnit.SECONDS.sleep(5);
		driver.quit();
	}

Expected behavior

Drag and drop should be correctly performed

Current result: the move to element reached a bad target coordinates and the mouse release is not performed.

PS: after some test, with clickAndHold / moveToElement/ Release actions it's not that the mouse release is not performed.
It's after the mouse move, we cannot performed any new actions (release, another move,... nothing!)

Environment

OS: Ubuntu 20.04 / Windows 10 (on virtualbox)
Browser: Chrome
Browser version: e93.0.4577.82
Browser Driver version: loading driver with io.github.bonigarcia.webdrivermanager
Language Bindings version: Java 3.141.59 / 4.0.0-rc-1

@ghost ghost added the A-needs-triaging A Selenium member will evaluate this soon! label Sep 21, 2021
@mdmintz
Copy link
Contributor

mdmintz commented Sep 21, 2021

@vduhautois Try from my following examples, which uses your same url: https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_drag_and_drop.py

@titusfortner titusfortner added G-w3c Requires change to W3C Spec and removed A-needs-triaging A Selenium member will evaluate this soon! labels Sep 22, 2021
@titusfortner
Copy link
Member

Thanks for filing this issue. It is a known bug with the drivers and is being tracked here: w3c/webdriver#1488

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
G-w3c Requires change to W3C Spec
Projects
None yet
Development

No branches or pull requests

3 participants