How do you perform drag and drop operation in webdriver?



How do you perform drag and drop operation in webdriver?..

Answer / Sanjay Kumar Chaubey

To perform a drag and drop operation in Selenium WebDriver, you need to use Actions class. Here's an example for dragging an element from one location to another:
```
Actions action = new Actions(driver);
WebElement source = driver.findElement(By.id("source"));
WebElement target = driver.findElement(By.id("target"));
action.dragAndDrop(source, target).build().perform();
```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Selenium Interview Questions

What are the main advantages of selenium?

1 Answers  


Why to use testng with selenium rc?

1 Answers  


How to export selenium ide test suite to selenium rc suites?

1 Answers  


What are the important features of selenium ide?

1 Answers  


How are selenium ide, webdriver and selenium rc different from each other?

1 Answers  


How do I start the browser using WebDriver?

1 Answers  


Explain what is the difference between find elements () and find element ()?

1 Answers  


How do you clear the contents of a textbox in selenium?

1 Answers  


What is exception test in selenium?

1 Answers  


What is selenium webdriver?

1 Answers  


What could be the cause of selenium webdriver test to fail?

1 Answers  


How you can login into any site if it’s showing any authentication popup for password and username?

1 Answers  


Categories