So I'm trying to upload a file with selenium webbrowser send_keys, but it doesn't work. Please help.
from selenium import webdriver
import time
driver = webdriver.Chrome(executable_path="../drivers/chromedriver")
driver.implicitly_wait(5)
driver.maximize_window()
driver.get("https://postimages.org/nl/")
element = driver.find_element_by_xpath("//*[@id='uploadFile']")
element.send_keys("Demo/test.png")
error is:
Traceback (most recent call last): File "/home/kuba/PycharmProjects/Test/Demo/UploadTest.py", line 12, in element.send_keys("Demo/test.png") File "/home/kuba/PycharmProjects/Test/venv/lib/python3.8/site-packages/selenium/webdriver/remote/webelement.py", line 477, in send_keys self._execute(Command.SEND_KEYS_TO_ELEMENT, File "/home/kuba/PycharmProjects/Test/venv/lib/python3.8/site-packages/selenium/webdriver/remote/webelement.py", line 633, in _execute return self._parent.execute(command, params) File "/home/kuba/PycharmProjects/Test/venv/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute self.error_handler.check_response(response) File "/home/kuba/PycharmProjects/Test/venv/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable (Session info: chrome=84.0.4147.89)