I'm trying to save the full content of the current static web page, using the code from http://stackoverflow.com/questions/3546047/show-save-as-dialog-of-ie-using-watin
So here it is:
IE ie = new IE("http://localhost"); // more code
//I expect out.html is the output file FileDownloadHandler fileDownloadHandler = new FileDownloadHandler("out.html");
//I expect this line to popup the save as dialog box, but nothing happens ie.AddDialogHandler(fileDownloadHandler);
//the program is blocked at this line, as it can't click anywhere ie.Link("startDownloadLinkId").Click();
fileDownloadHandler.WaitUntilFileDownloadDialogIsHandled(15);
fileDownloadHandler.WaitUntilDownloadCompleted(200);
I also tried the code below, but it doesn't save all the page: System.IO.StreamWriter file = new System.IO.StreamWriter("output.html"); file.Write(ie.Html);
Again, I need to save the webpage from Watin, and the result to be the same as saving it manually.
Thanks!