Drag and drop in selenium

0 votes
Is there any way to use the functionality of Drag and Drop in selenium? Can someone help me with this? Thank you in advance.
Jan 8, 2019 in Selenium by Anjali
• 2,950 points
1,554 views

2 answers to this question.

0 votes

Here is what I did, you can take a look at the code below:

Actions builder = new Actions(driver);
Action dragAndDrop = builder.clickAndHold(SourceElement)
moveToElement(TargetElement)
release(TargetElement)
build();
dragAndDrop.perform();

Hope this helps

For more, check out this blog on how to drag and drop in Selenium.

answered Jan 8, 2019 by Dish
0 votes

WebElement dragale = driver.findElement(By.xpath("//*[@id=\"draggable\"]/p"));

WebElement dropable = driver.findElement(By.xpath("//*[@id=\"droppable\"]"));

Actions drag_drop_action = new Actions(driver);

drag_drop_action.dragAndDrop(dragale, dropable).perform();

answered May 4, 2020 by dragAndDrop(WebElement source, WebElemen

Related Questions In Selenium

0 votes
0 answers

how to do search name and drag and drop in hybrid frame work java selenium?

i have to do following things first i ...READ MORE

Sep 10, 2020 in Selenium by anonymous
• 120 points
550 views
0 votes
1 answer

Selenium + Java - drag and drop not working on selenium 3.8

How about you try adding the below ...READ MORE

answered Mar 28, 2018 in Selenium by nsv999
• 5,500 points
5,206 views
0 votes
1 answer

Python Selenium WebDriver drag-and-drop

I have verified that this does in ...READ MORE

answered Aug 23, 2018 in Selenium by Meci Matt
• 9,460 points
4,269 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
13,771 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
9,187 views
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
7,263 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
7,901 views
0 votes
1 answer

Testing in Selenium

Out of many testing supported by selenium ...READ MORE

answered Jan 8, 2019 in Selenium by Disha
853 views
0 votes
1 answer

What are the different components of Selenium?

Selenium is a testing tool and comprises ...READ MORE

answered Jan 8, 2019 in Selenium by Fuji
1,559 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