Actions class seems to be pretty old now to handle the drag and drop action. Frosty selenium drag drop helps the user to simulate the drag and drop action with the help of JQuery. Thanks to rcorreia for creating the helper js file. You can view that JS file here
Just download the jar file from here. Add this jar file in the project build path and you are ready to use this jar file in your project.
As it is based on the Jquery, you must have the basic knowledge of JQuery selectors. If you want to know more about the Jquery Selectors then click here
Step 1: Object creation
DragAndDropAction action = new DragAndDropAction()
Step 2: Finding selector data
You can use source and target elements ID in order to perform the drag and drop operation.
Step3: Calling perform method.
action.perform(driver, "#source", "#target"); // here # is means we are using ID selector to perform drag and drop operation.
WebDriver driver = new ChromeDriver();
driver.get("http://www.seleniumframework.com/Practiceform/");
driver.manage().window().maximize();
new DragAndDropAction().perform(driver, "#draga", "#dragb");
- Abhishek Prajapati - Initial work - Frostyaxe
- GitHub: Frostyaxe
- Gmail: prajapatiabhishek1996@gmail.com