I am working on a tool that automatically submits files to a website using Selenium and ChromeDriver.
Usually uploading files is easy with Selenium since you can just give the information to the <input type="file">
element. However, in this case I am working with a website that has a custom file upload button, there is no <input type="file">
anywhere on the page and the upload happens instantly after selecting a file in the file upload dialog (like this):
Therefore, my only option is to have Selenium click on the custom upload button and control the file dialog. But I can't figure out how to do this. How do I use Selenium to control the OS/browser file upload dialog?
I have seen this SO question which doesn't seem to apply to me because they have <input type="file">
on the page and are trying to trigger the upload dialog, but I do not have that element and I do not have a problem triggering the dialog, my problem is with controlling the dialog once it's open. I have also read several questions on SO about uploading multiple files and none have information that can help my situation.