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,950 points
998 views

2 answers 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,520 points
0 votes
		
         Actions act=new Actions(driver);					

			
         act.dragAndDrop(From, To).build().perform();
answered Sep 3 by Sri
• 2,970 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,710 points
1,439 views
0 votes
2 answers
0 votes
2 answers

What is the best way to handle a Javascript popup using Selenium Webdriver?

webDriver.switchTo().alert() it inbuild selenium only //Store the alert ...READ MORE

answered Sep 2 in Selenium by Sri
• 2,970 points
3,917 views
0 votes
1 answer
0 votes
2 answers

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,520 points
3,746 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31 in Selenium by Sri
• 2,970 points
4,730 views
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,890 points
2,725 views
+1 vote
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,520 points
4,486 views
0 votes
2 answers

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

JavascriptExecutor jsx = (JavascriptExecutor)driver; jsx.executeScript("window.scrollBy(0,555)", ""); or Action classes ...READ MORE

answered Sep 5 in Selenium by Sri
• 2,970 points
13,497 views