I am unable to upload a file to a website using selenium python,
My code runs well till Clicking the upload button and opening the Windows file browser frame.
sendkeys doesnot work
AutoIT doesnot work
How do i use this. I tried it but it doesnot works?
browser.find_element_by_xpath("//input[@type='file']").send_keys(filepath)
driver = webdriver.Chrome("C:/Users/path/Downloads/path/chromedriver.exe")
driver.get("http://abc.xys")
elem = driver.find_element_by_id("id_username")
elem.send_keys(user)
elem = driver.find_element_by_id("id_password")
elem.send_keys(pwd)`enter code here`
elem.send_keys(Keys.RETURN)
Upload_button = driver.find_element_by_xpath("/html/body/div[2]/div/div[1]/div[2]/button").send_keys(r'''C:\Users\path\Pictures\test22.jpg''')
I expect the image file to be uploaded