Uploading a file in Selenium with Python

One of the problems we face is the “File Upload Window” is not a Popup window always as sometimes it may open a Window specific to the OS.

The best way to solve this issue is by setting the value of fileupload element directly to the file path like shown below

//Code for File Upload
file_input = driver.find_element_by_id("uploadBtn")
file_input.send_keys("/absolute/path/to/file")


You may also like...