Friday 15 May 2015

Web Driver API-Drag and Drop



Drag and Drop -Webdriver API Action Class

Now sometimes there may be required to automate the some functionality which has drag and drop functionality. Now we have taken the example of program to perform drag and drop operation. In the below example, as we know that the DragAndDrop divs are in a Frame, First we need to switch to the frame before performing the drag and drop operation. And after that you also need to check for the availability of Source Element and Destination Elements in UI.

Syntax for drag and drop is below:-

Actions action = new Actions(driver);
action.dragAndDrop(Sourcelocator, Destinationlocator).build().perform();
You can also make it as like below:

(new Actions(driver)).dragAndDrop(element, target).perform();
https://www.youtube.com/watch?v=TmHILJhJfFo
https://www.youtube.com/watch?v=odxU3L1OB-M

https://www.youtube.com/watch?v=HPx-LWaYzFE
https://www.youtube.com/watch?v=WlQ-xpOACpE
https://www.youtube.com/watch?v=odxU3L1OB-M
https://www.youtube.com/watch?v=TmHILJhJfFo

No comments:

Post a Comment