Please bear with me, I'm new to both Python and Webdriver, but I'm having trouble getting ActionChains to work when inside a function.
Running this is fine: -
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()
..but running this causes an error: -
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()
The error I get is: -
AttributeError: 'NoneType' object has no attribute 'w3c'
Any help would be greatly appreciated...