I am trying to test my application where I need to move a widget from one location to other, in other word I need to test drag & drop functionality in an end to end test.
How would I test this?
Drag Clicking is when you drag your finger down from the top of the mouse button. This creates friction which basically accidentally tricks the mouse switch to register multiple clicks as you drag your finger down.
To drag click, simply flick your wrist slightly at an angle while gently pressing the mouse button in a downward direction (towards the front of the mouse). Don't press too hard, and just allow your finger to glide through the button. You'll know that you're doing it right if you start to hear a “grinding noise”.
Drag clicking is a way to perform multiple clicks on a mouse without the energy or effort of clicking very fast. It only takes one motion of your finger to create a multitude of clicks, and you will not feel any pressure or stress after doing this.
A double tap acts as a double click. A double tap and hold allows you to grab and then drag. A two-finger tap acts as a right click. A two-finger drag reproduces the mouse wheel scrolling action.
I had this same issue. The solution for me was to follow the advice in the Selenium issue here: https://code.google.com/p/selenium/issues/detail?id=3604#c20
Starting with the example from @nilsK, here was my solution:
var yourOffset = {x:5,y:5};
ptor().actions()
.mouseMove(yourElement,yourOffset)
.mouseDown()
.mouseMove(yourElement,{x:0,y:0}) // Initial move to trigger drag start
.mouseMove(youTarget[,targetOffset]) // [] optional
.mouseUp()
.perform();
I think this also solves this issue
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With