Uploading a File

Learn how you can upload a file with Selenium, and try it out yourself.

We'll cover the following

Uploading a file

In this chapter, we will learn how to upload a file and deal with its pop-up dialogs. Most of the time, the pop-up dialogs, like Choose a File to upload, etc., are native windows dialogs rather than browser dialogs. Thus, it could create problems while testing, as Selenium can only drive browsers and not windows. So, if the pop-up dialog is not handled properly, the test execution will halt. Below is an example of uploading a file in windows.

Get hands-on with 1200+ tech skills courses.