When i tried `ActionChains(driver).drag_and_drop(drag,drop).perform()` it didn't work for me. It shows that I select the elements, but never drag it. What worked for me is this answer [1] in a separate question.
You can try it in the following way.
drag = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "xpath1")))
drop = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "xpath2")))
action = ActionChains(driver)
action.click_and_hold(drag).pause(2).move_to_element(drop).release(drop).perform()
These are the required imports:
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
[1]
https://stackoverflow.com/a/60000050/18201390
When i tried `ActionChains(driver).drag_and_drop(drag,drop).perform()` it didn't work for me. It shows that I select the elements, but never drag it. What worked for me is this answer [1] in a separate question.
You can try it in the following way.
drag = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "xpath1")))
drop = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "xpath2")))
action = ActionChains(driver)
action.click_and_hold(drag).pause(2).move_to_element(drop).release(drop).perform()
These are the required imports:
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
[1]
https://stackoverflow.com/a/60000050/18201390