-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Protractor failed to drag and drop elements #2293
Comments
@juliemr just like @wangfeiv I tried both: browser.actions().dragAndDrop(draggable_element, target_element).perform(); and: browser.actions().
mouseDown(draggable_element).
mouseMove(target_element).
mouseUp().
perform(); where expect(draggable_element.isPresent()).toEqual(true);
expect(target_element.isPresent()).toEqual(true);
The full code of my spec looks like this: var draggable_element = element(...);
var target_element = element(...);
expect(draggable_element.isPresent()).toEqual(true);
expect(target_element.isPresent()).toEqual(true);
browser.actions().dragAndDrop(draggable_element, target_element).perform();
expect(element.all(by.css('tr')).count()).toEqual(1); The last expectation fails: I've read #1205, but it seems to me only a discussion about how to improve the syntax. Instead, I would like to know if and how I can test drag and drop. Also, where should I search actions documentation? The Official API is really too short. About #583, my test is failing both in Chrome and in Firefox. My OS is Ubuntu Gnome 14.04. Note that I'm 100% sure that my directives work fine. I checked with a couple of demo apps and with several unit-tests. |
@marcoliceti did you ever figure this out currently reading through trying to figure out how to drag and drop an element and cannot get it to work for me! My code is pretty much the same but cannot find a way to get it working. |
@EvanBurbidge: nope :-/ In the end I removed Protractor tests from my project, since it's very hard to test non-trivial stuff like drag & drop and it's also hard to get help, since it's usually not clear if issues are related to Protractor itself or to Selenium. |
That's a shame, this is an important feature... |
I have the same problem( |
I got the same issue. I saw the content of the page has been "selected when clicking the mouse down, hold and move". Is there any solution for this case. |
I tried to use protractor to simulate dragAndDrop, but it did not work, and there was no any error about it, below is my test code:
this.dragAndDropDashboardTab = function(source, target) {
// Way-1: it did not work
// browser.actions().dragAndDrop(source, target).perform();
// browser.actions()
// .mouseDown(source)
// .mouseMove(target)
// .mouseUp()
// .perform();
// Way-2: it did not work
// browser.actions().dragAndDrop(source, target).perform();
};
Who will tell me the work around? And would you like to help me fix this issue?
The text was updated successfully, but these errors were encountered: