InterviewSolution
Saved Bookmarks
| 1. |
How to perform drag and drop using WebDriver? |
|
Answer» Now a day, many web APPLICATIONS have the functionality to drag an element and drop it on a defined area. There are two METHODS in Actions class which SUPPORTS drag and drop -
Here we pass two parameters, first "sourcelocator" is the element we need to drag. The second PARAMETER is "Destinationlocator" which is the element on which we need to drop the first element.
Here we pass three parameters, first "source locator", the second is x-axis pixel VALUE of the 2nd element on which we need to drop the first element and third is y-axis pixel value of the 2nd element. Ex. Actions act=new Actions(driver); act.dragAndDrop(From, To).build().perform(); |
|