I am trying to import image to the google form. I am failing to pass keys to the element via xpath. It seems it is a hidden element.
I have tried to execute scripts to unhide it, but with no success. Tried this solutions also: How to access hidden file upload field with Selenium WebDriver python
Python-Selenium "input type file" upload
Does anybody have a method to import to google forms via drag and drop file dialog box.
I usually get an error:
NoSuchElementException: no such element: Unable to locate element:
I am sending some pseudocode:
from selenium import webdriver
browser = webdriver.Chrome()
browser.get('ANY GOOGLE FORM URL')
browser.find_element_by_xpath('//*[@id="mG61Hd"]/div/div[2]/div[2]/div[5]/div/div[3]/span/span').click()
fileinput = browser.find_element_by_xpath("//div[contains(@class,'Nf-Er-Xr')]")
fileinput.send_keys('some image path')