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
• 11,380 points
1,231 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, 2020 by Sri
• 3,010 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
2,110 views
0 votes
2 answers

Is there any way to get the text of a web element using Selenium Webdriver?

use gettext() in java : string lableText = ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,010 points
5,617 views
0 votes
1 answer

Is there a way to get element by XPath using JavaScript in Selenium WebDriver?

You can use the document.evaluate: Evaluates an XPath ...READ MORE

answered Nov 26, 2020 in Selenium by Gitika
• 65,870 points
997 views
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, 2020 in Selenium by Sri
• 3,010 points
5,484 views
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
4,878 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

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

answered Aug 31, 2020 in Selenium by Sri
• 3,010 points
5,682 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
3,465 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
5,257 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, 2020 in Selenium by Sri
• 3,010 points
14,763 views