How to deal with file uploading in test automation using selenium or webdriver

Webdriver can handle this quite easily in IE and Firefox. Its a simple case of finding the element and typing into it.

driver = webdriver.Firefox()
element = driver.find_element_by_id("fileUpload")
element.send_keys("myfile.txt")

The above example is in Python but you get the idea

Leave a Comment