Search code examples
c#watin

Click on Save or SaveAs dialog of file download


I have seen couple of question posted on this topic but none of the solution worked that's why I am posting it again.

I am using WatIn to automate the testing of my website. Using IE 11. I have to download and save the file, but I am not able to click the save or saveas button of the download window. I tried FileDownloadHandler of WatIn but it didn't worked. I am not limited to WatIn only solutions. It could be anything thing which I can use in my C# code will be acceptable

FileDownloadHandler fileDownloadHandler = new FileDownloadHandler();
browser.AddDialogHandler(fileDownloadHandler);
browser.Image(Find.ByAlt("Download.Csv")).Ancestor("a").ClickNoWait();
fileDownloadHandler.WaitUntilFileDownloadDialogIsHandled(40);
fileDownloadHandler.WaitUntilDownloadCompleted(200);

Solution

  • I am using IE 11 and was able to download and close the dialog box

    Automate of file download in IE 11 using c#