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

			
         act.dragAndDrop(From, To).build().perform();
answered Sep 4, 2020 by Sri
• 3,190 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
4,621 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,190 points
8,172 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 27, 2020 in Selenium by Gitika
• 65,910 points
3,632 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 3, 2020 in Selenium by Sri
• 3,190 points
10,400 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,500 points
12,715 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,190 points
8,608 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,910 points
6,684 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,500 points
7,955 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 6, 2020 in Selenium by Sri
• 3,190 points
18,489 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP