HTML5 dragging does not always work on Chrome
See original GitHub issueFollowing test case:
describe('Drag materials', function() {
ptor = protractor.getInstance();
beforeEach(function() {
browser.get('http://tombatossals.github.io/angular-leaflet-directive/examples/center-example.html');
});
describe('draggable map', function() {
it('Drag Test', function() {
var el = element(by.xpath('.//img[contains(@class, "leaflet-tile-loaded")][1]'));
ptor.actions().dragAndDrop(el.find(),{x:40,y:40}).perform();
expect(element(by.model("london.lat")).getAttribute("value")).not.toBe('51.505');
});
});
});
The test does not seem to drag the map. There is also no drop possible with the following test page: http://html5demos.com/drag that seems the same problem.
describe('Drag materials', function() {
ptor = protractor.getInstance();
beforeEach(function() {
browser.get('http://html5demos.com/drag');
});
describe('draggable map', function() {
it('Drag Test', function() {
var item = element(by.xpath('//*/a[@id="one"]'));
var dest = element(by.xpath('//*/div[@id="bin"]'));
ptor.actions().dragAndDrop(el.find()dest.find()).perform();
ptor.sleep(6000);
});
});
});
The drag and drop does even not work with mouseevents:
describe('Drag materials', function() {
ptor = protractor.getInstance();
beforeEach(function() {
browser.get('http://html5demos.com/drag');
});
describe('draggable map', function() {
it('Drag Test', function() {
var item = element(by.xpath('//*/a[@id="one"]'));
var dest = element(by.xpath('//*/div[@id="bin"]'));
ptor.actions().mouseMove(item.find()).
mouseDown(item.find()).
mouseMove(dest.find()).
mouseUp(dest.find()).
perform();
ptor.sleep(6000);
});
});
});
Issue Analytics
- State:
- Created 10 years ago
- Reactions:2
- Comments:31 (7 by maintainers)
Top Results From Across the Web
HTML5 Drag not working with Chrome if there is a focused ...
The text "My div text" cannot be dragged into the rectangle, neither by repeat attempts, so Chrome blocks dragging for the user. Clicking ......
Read more >Drag and drop not working - Google Chrome Community
I'm unable to drag and drop search results from the results page into a new tab. However, I'm able to drag external links...
Read more >Google Chrome's drag drop feature stopped working
Running Chrome as an administrator is causing this problem. Just go to chrome.exe settings and disable it. Restart ...
Read more >Touch Drag and Drop Isn't Working in Chrome Browser
Fixing Drag-and-Drop · Type "Touch" into the search bar and set the following options to "Enabled". · You will have to relaunch Google...
Read more >2695 - HTML5 drag and drop is not working - chromedriver
HTML5 drag and drop is not working. Steps to reproduce: 1. Have a python environment with the selenium pip packages installed. 2. Run...
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 FreeTop 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
Top GitHub Comments
Resolved I used the HTML Drag and Drop Simulator from GitHub https://github.com/PloughingAByteField/html-dnd
Working code:
but offsetX & offsetY not working for me
Hi, everyone! I also had the same issue but with Firefox browser. Many actions such as DnD, right mouse button click, .etc don’t work when running test in Firefox. Here is my implementation of these actions: https://github.com/IgorSasovets/protractor-firefox-support . Now I’m still working on it, but there are some methods that can be used for writing e2e tests using protractor. Protractor version: 5.2.0 Firefox: 57.0.4 geckodriver: v0.19.1