import org.openqa.selenium.interactions.Actions;
/*
*/
WebElement draggable=driver.findElement(By.xpath(".//*[@id='draggable']/p"));
WebElement dropable=driver.findElement(By.xpath(".//*[@id='droppable']/p"));
Actions action= new Actions(driver);
action.clickAndHold(draggable).build().perform();
action.moveToElement(dropable).build().perform();
action.release(dropable).build().perform();
or
//above mentioned 3 lines can be merge in a single line.
action.clickAndHold(draggable).moveToElement(dropable).release().build().perform();
/*
*/
WebElement draggable=driver.findElement(By.xpath(".//*[@id='draggable']/p"));
WebElement dropable=driver.findElement(By.xpath(".//*[@id='droppable']/p"));
Actions action= new Actions(driver);
action.clickAndHold(draggable).build().perform();
action.moveToElement(dropable).build().perform();
action.release(dropable).build().perform();
or
//above mentioned 3 lines can be merge in a single line.
action.clickAndHold(draggable).moveToElement(dropable).release().build().perform();
1 Comments
Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
ReplyDeletePython Training in electronic city
DataScience with Python Training in electronic city
AWS Training in electronic city
Big Data Hadoop Training in electronic city
Devops Training in electronic city