HTML5 dragging does not always work on Chrome
Following 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);
});
});
});
There's some webdriver weirdness around drag and drop - let's pass these along to the webdriver team. Which browser are you using?
I use Chrome latest version. Did you raise an error report to the webdriver team? Or do I still have to do it ?
I have a set of webdriver-related things to look into - I'll add it to my list and take care of it.
I found an issue in selenium https://code.google.com/p/selenium/issues/detail?id=3604 Looks like it is the same problem.
The mouse movements seem to work for both the dragAndDrop and chained mouseDown mouseMove actions. But none of the HTML5 drag events (dragstart, dragend, dragover, dragenter, dragleave, and drop) are firing. This is using the Chrome driver.
@juliemr Looks like this issue still exists. I am not able to drag and drop an element in chrome browser. The same code works fine in firefox. If you can help me it would be really great. I am using protractor v1.0 and latest chrome browser.
Ditto. Drag and drop working fine in Firefox but not in Chrome. Using Chrome 36, Firefox 31. and protractor 1.0.0 with chromedriver.
I'm having the same problem - Protractor 1.3.1 - Chrome 37.0 - Firefox - 28.
Using the following code to drag and drop
browser.actions().dragAndDrop(slider, {x: amountX, y: amountY}).perform();
On 22 August 2014 16:08, cristover-lopes [email protected] wrote:
Ditto. Drag and drop working fine in Firefox but not in Chrome. Using Chrome 36, Firefox 31. and protractor 1.0.0.
— Reply to this email directly or view it on GitHub https://github.com/angular/protractor/issues/583#issuecomment-53072219.
@hankduan Let's make a test case without using Protractor and add to https://github.com/juliemr/webdriver-bugs
Is this test case necessary. It seems like it's a known issue documented here: https://code.google.com/p/selenium/issues/detail?id=3604
Yup, good call. Known issue: https://code.google.com/p/selenium/issues/detail?id=3604
Still facing this problem on Chrome driver. Any updates if this issue is fixed!!
Im new to the Protractor -- i have to automate the drag and drop Is there any workaround for this issue please help me on this guys.
ptor = protractor.getInstance(); var item = element.all(by.css('div[dnd-moved="list.splice($index, 1)"]')); var dest = element.all(by.css('div.panel-body')); ptor.actions().mouseMove(item.find()). mouseDown(item.find()). mouseMove(dest.find()). mouseUp(dest.find()). perform(); ptor.sleep(6000);
I have the same problem. My test tries to simulate a panning over an svg graph. Besides panning, the graph shows tooltips of values when the mouse passes over its area.
I simplified at the maximum the code to see if something was wrong in accessing the elements. However, when I execute the test, it seems like only mouseover events are fired, since tooltips are shown at the start and end points of the drag.
browser.actions()
.mouseMove({x: 500, y: 300})
.mouseDown()
.mouseMove({x: -500, y: 0})
.mouseUp().perform();
browser.sleep(3000);
Note: I fixed the window size so the coordinates of the code are correct.
Is there any update on this issue?
Same issue here!
Same issue was this ever resolved?
+1 need a solution
+1
Is this the root issue?
https://bugs.chromium.org/p/chromedriver/issues/detail?id=841
I guess so