Python Selenium WebDriver drag-and-drop

0 votes

The drag-and-drop is not working with the Python WebDriver bindings. I am working with Google Chrome and Firefox on Mac OS X. 

I used ActionsChains:

from selenium import webdriver
from selenium.webdriver import ActionChains
driver = webdriver.Chrome()
actionChains = ActionChains(driver)

actionChains.drag_and_drop(source, target).perform()

How to get the Python WebDriver drag-and-drop work?

Aug 23, 2018 in Selenium by Perry
• 17,010 points
431 views

1 answer to this question.

0 votes

I have verified that this does in fact work on Mac:

from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains

driver = webdriver.Firefox()
driver.get("your.site.with.dragndrop.functionality.com")
source_element = driver.find_element_by_name('your element to drag')
dest_element = driver.find_element_by_name('element to drag to')
ActionChains(driver).drag_and_drop(source_element, dest_element).perform()
answered Aug 23, 2018 by Meci Matt
• 9,400 points

Related Questions In Selenium

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,050 points
1,231 views
0 votes
1 answer
0 votes
1 answer

Drag and drop in selenium

Here is what I did, you can ...READ MORE

answered Jan 7 in Selenium by Dish
87 views
0 votes
1 answer

Python & Selenium: How to find and click on YouTube's Like button

Use the CSS Selector button to like: #watch8-sentiment-actions ...READ MORE

answered Mar 26, 2018 in Selenium by nsv999
• 5,050 points
505 views
0 votes
1 answer

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,050 points
262 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,130 points
629 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
258 views
0 votes
1 answer
0 votes
1 answer