Solution : I use click_and_hold, move_to_element, click and release methods to completed this action.
python:
righttree = driver.find_element_by_xpath(".//*[@id='right']/ul/li[1]/span/span[3]")
target = driver.find_element_by_xpath(".//*[@id='left']/ul/li[1]/span")
actions = ActionChains(driver)
actions.click_and_hold(righttree)
actions.move_to_element(target)
actions.click(target)
actions.release()
actions.perform()
WebDriverWait(driver, 10).until(
(EC.element_to_be_clickable((By.XPATH, ".//*[@id='left']/ul/li[1]/ul/li/span/span[3]"))))
time.sleep(2)
No comments:
Post a Comment