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 7, 2019 in Selenium by Anjali
• 2,950 points
570 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
 

answered Jan 7, 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 3, 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 9, 2020 in Selenium by anonymous
• 120 points
60 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 27, 2018 in Selenium by nsv999
• 5,520 points
3,048 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
2,896 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,340 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,259 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,890 points
3,140 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 2, 2020 in Selenium by Sri
• 3,010 points
3,650 views
0 votes
1 answer

Testing in Selenium

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

answered Jan 7, 2019 in Selenium by Disha
56 views
0 votes
1 answer

What are the different components of Selenium?

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

answered Jan 7, 2019 in Selenium by Fuji
551 views