Web application testing is not only about the on-screen functionality but also involves interacting with external resources, such as images, documents and other media.
To upload a file using Selenium, the file path is needed to be set in the
input element control before submitting the form.
On the form the control to inspect should look like the image below.
When the folder button is clicked the folder dialog is displayed by the browser.
The HTML input element should look similar to the code below.
Take note of the
<input id="fileUpload" type="file">Browse.