question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

selenium can't drag Canvas elements

See original GitHub issue

šŸ› Bug Report

There are abnormalities in the functions such as click, double-click, drag and drop of Canvas used by Selenium to automate testing. The specific reason is that Selenium cannot get the elements inside Canvas.

To Reproduce

Exercising a pageā€™s dragging and dropping functionailty used to be simple with Seleniumsā€™s Action Builder, but sadly ,it wonā€™t work with HTML5 drag and drop .

We use the selenium function ā€˜Actions.dragAndDrop(source,target)ā€™ to control the elements inside canvas,it dosenā€™t work that way for selenium canā€™t select the element .

Expected behavior

selenium can drap canvas elements

Test script or set of commands reproducing this issue

Actions actions = new Action(driver);
actions.dragAndDrop(source,target)ļ¼›

The code dosenā€™t work ,also no exception.

Environment

OS: Windows 10 Browser: Chrome Browser version: 90.0.4430.24 Browser Driver version: 90.0.4430.24
Language Bindings version: Java 8 c

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
diemolcommented, Jun 17, 2021

What is running in driver.get("http://localhost:9528");? We need to have access to the page. What Selenium version are you using?

0reactions
github-actions[bot]commented, Sep 5, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to drag drop elements from task palette to canvas ...
We're trying to accomplish the scenario in the above screenshot where we drag elements from task palette to the canvas through Selenium ......
Read more >
How do I use Selenium to drag and drop drawing elements ...
1 Answer 1 ... You can try using Actions for drag and drop actions. Actions dragdrop = new Actions(driver); WebElement object1 = driver....
Read more >
Chrome Drag and Drop not working for ... - Stack Overflow
Chrome Drag and Drop not working for Canvas Element with Selenium ... from one canvas(HTML5 element) to another canvas so I cannot use...
Read more >
Chrome Drag and Drop not working for Canvas Element with ...
I am using Selenium 2.53.1, Selenium Support Class 2.53.1 and Chrome Version 59.0.3071.115 and Chrome Driver 2.30. It seems like drag and drop...
Read more >
Drag and Drop Action in Selenium webdriver using Actions class
Using Selenium, it is almost not possible to locate canvas tag because contents inside this tag are always dynamic. Reply. SATVEER BAJWA says....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found