Interview Questions

Selenium WebDriver - How do perform drag and drop using WebDriver?

Selenium WebDriver Interview question and Answers


(Continued from previous question...)

Selenium WebDriver - How do perform drag and drop using WebDriver?

Use Action class
Actions act = new Actions(driver); WebElement source = driver.findElement(By.xpath( -----)); //source ele which you want to drag WebElement target = driver.findElement(By.xpath( -----)); //target where you want to drop act.dragAndDrop(source,target).perform();
Actions act = new Actions(driver);
WebElement source = driver.findElement(By.xpath( -----)); //source ele which you want to drag
WebElement target = driver.findElement(By.xpath( -----)); //target where you want to drop
act.dragAndDrop(source,target).perform();

(Continued on next question...)

Other Interview Questions