I'm writing an automated test that is supposed to import a series of files through the UI of a web application. You click the "Import" button and it opens Windows Explorer. I use the following XPATH in my test:
filename_field = //div[contains(@class, 'DocumentGrid')]//input[contains(@type, 'file')]
I'm getting an InvalidElementStateException.
Message: invalid element state: Element is not currently interactable and may not be manipulated
Here is a sample of my test code:
element = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, Tags.filename_field))
element.send_keys(Keys.importFilePath)
I'm not sure why I'm getting this error. This code worked with a different web application, but this one I'm working on now was built using the React framework and the other was not. Not sure if that makes a difference.