Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98800

Angular drag & drop with HTML5 not working through Selenium and Python

$
0
0

My code does not working on demo AngularJS Drag and Drop list: http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/simple

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

driver = webdriver.Firefox()
driver.get("http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/simple")
time.sleep(2)
source_element = driver.find_element_by_xpath('/html/body/div[2]/div[2]/div[2]/div[1]/div[1]/div[1]/div/div[2]/ul/li[1]')
dest_element = driver.find_element_by_xpath('/html/body/div[2]/div[2]/div[2]/div[1]/div[1]/div[2]/div/div[2]/ul/li[3]')

actions = ActionChains(driver)
actions.drag_and_drop(source_element, dest_element)
actions.perform()
time.sleep(10)
os.system("taskkill /im firefox.exe /f")

I try many solutions, but it is not working. By my opinion, problem is in "drop" action.


Viewing all articles
Browse latest Browse all 98800


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>