请耐心等待我,我是Python和Webdriver的新手,但我在使用ActionChains时无法使用。
运行这个很好: -
wait.until(ec.presence_of_element_located((By.XPATH, "//*[@id='bulk-upload-patient-spreadsheet']/div[1]/div/div/div/table/tbody/tr[2]/td[1]"))).click()
actions = ActionChains(driver)
actions.send_keys("test")
actions.perform()
..但是运行它会导致错误: -
def test_function(self):
wait = initialisation.wait_for(self.driver)
self.driver = login.default_login(self.driver)
wait.until(ec.presence_of_element_located((By.XPATH, "//*[@id='bulk-upload-patient-spreadsheet']/div[1]/div/div/div/table/tbody/tr[2]/td[1]"))).click()
actions = ActionChains(self.driver)
actions.send_keys("test")
actions.perform()
我得到的错误是: -
AttributeError: 'NoneType' object has no attribute 'w3c'
非常感谢任何帮助......