I am writing some regression tests in WatiN and needed to make a couple POST web requests. The requests are working fine but I get an annoying dialog box asking me if I want to save the file or find a program online to open it. The line of code that is causing this is:
browser.Navigate2(ref uri, ref nflags, ref ntargetFrame,
ref dataBytes, ref headers);
Is anyone familiar with the Navigate2() method? Any idea on how to get rid of this download box?
Here is my answer:
The Navigate2() method looks like this:
the flags can be defined as enum BrowserNavConstants like this:
I used navUnstrustedForDownload and it did away with the download box. Hope this helps someone somewhere