Is there a way to automate the drag & drop functionality in Selenium WebDriver (Java)

0 votes
Is there a way to automate the drag & drop functionality in Selenium WebDriver written using java code?
Apr 4, 2018 in Selenium by nitinrawat895
• 10,670 points
320 views

1 answer to this question.

0 votes

You can implement the drag and drop functionality like this:

WebElement element = driver.findElement(By.name("source"));
WebElement target = driver.findElement(By.name("target"));

(new Actions(driver)).dragAndDrop(element, target).perform();

Source: https://www.seleniumhq.org/docs/03_webdriver.jsp#drag-and-drop
You can look at Selenium's documentation from above for further reference.

answered Apr 4, 2018 by nsv999
• 5,090 points

Related Questions In Selenium

0 votes
1 answer

Is there a way to pass on the options/ flags to Selenium if i'm scripting in Python?

This is the usage: from selenium import webdriver from ...READ MORE

answered Jun 8, 2018 in Selenium by king_kenny
• 3,650 points
225 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,090 points
545 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
880 views
0 votes
1 answer

How to handle drop downs using Selenium WebDriver in Java

First, find an XPath which will return ...READ MORE

answered Mar 27, 2018 in Selenium by nsv999
• 5,090 points
1,953 views
0 votes
1 answer

How to scroll the Page up or down in Selenium WebDriver? (using java)

Its pretty simple. Check out the below ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,090 points
7,076 views