Skip to content

Instantly share code, notes, and snippets.

@RobK
Last active March 14, 2016 10:26
Show Gist options
  • Save RobK/cf84b756270908d794c3 to your computer and use it in GitHub Desktop.
Save RobK/cf84b756270908d794c3 to your computer and use it in GitHub Desktop.
"Drag and drop test (useCss)" : function (browser) {
browser
.useCss()
.moveToElement('#draggable', 0, 0)
.mouseButtonDown(0)
.moveToElement('body', 200, 600) // Move to offset position of 200(x) 600(y)
.mouseButtonUp(0)
.pause(5000) // Keep browser open for 5 seconds so you can see result
.end();
}
@georgevj2
Copy link

Hei,

I'm using the exact code, the problem is that after the mouseButtonDown(0) action the mouse just stops there and does not go to the location where it suppose to drop the element (ie. moveToElement('body', 200, 600).
I have to manually move the mouse and after that the mouseButtonUp occurs...

Any idea what's happening?
Thanks

@himanshuteotia
Copy link

you can also use :-
.execute('scrollTo(0,3000)')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment