2017-03-12 1 views
0

다음 코드를 사용하여 Selenium Webdriver에서 슬라이더를 이동하려고하는데 "selenium.common.exceptions.WebDriverException : Message : POST/session/38618f26-c271-41f3-a019-990ee2558063/moveto가 알려진 명령과 일치하지 않습니다. "Selenium Webdriver에서 slider를 이동하기 위해 drag_and_drop을 사용할 수 없습니다.

셀레늄 3.0.2와 파이어 폭스 51.0.1을 사용하고 있습니다. 무엇을 잘못하고 있습니까? 어떻게 슬라이더를 움직일 수 있습니까?

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

browser = webdriver.Firefox() 
browser.get("http://url_wuth_a_slider") 

source_element = browser.find_element_by_xpath("xpath_to_slider_knob") 
destination_element = browser.find_element_by_xpath("xpath_to_destination") 
ActionChains(browser).drag_and_drop(source_element, destination_element).perform() 

답변

0

이것은 known issue with the selenium bindings and geckodriver입니다. Chrome에서 정상적으로 작동하는 것 같습니다. 당신이 marrionette을 사용하지 않으면 그것은 파이어 폭스에서 작동 할 수 있습니다 (하지만 당신은 파이어 폭스 전 50 버전을 사용해야 할 수도 있습니다) :

browser = webdriver.Firefox(capabilities = { "marionette": False }) 

하지만 당신의 가장 좋은 방법은 크롬입니다.

+0

감사합니다. Chrome에서 정상적으로 작동했습니다. – sprogissd

관련 문제