Thursday, March 15, 2018

Selenium C# - How to automatically download your file

If you want to check with Selenium that a specific file was downloaded, you need to start the new driver with some options, because the browser will show the Save popup that cannot be handled by Selenium.

You can do this by using this code in C# for Firefox and Chrome:




For IE, things are a little bit tricky, so you might try integrating TestSlack.White library and simulate the click on Save button with this library.

Later, you can create a test like this:


Happy testing and... make it green, becomes a dream :).


No comments:

Post a Comment

Popular Posts