GoTo not working properly after file download
Brought to you by:
jvmenen
After downloading a file, the GoTo command is not working properly. The browser navgigates to the next page properly but fields like URL are not updated. I was able to reproduce the issue using the following code:
IE ie = new IE();
ie.GoTo(@"http://code.google.com/p/license-adder/downloads/detail?name=LicenseAdder-v1.0.1.zip&can=2&q=#makechanges");
// Starting the download
FileDownloadHandler fdHandler = new FileDownloadHandler(@"C:\LicenseAdder-v1.0.1.zip");
if (File.Exists(@"C:\LicenseAdder-v1.0.1.zip")) File.Delete(@"C:\LicenseAdder-v1.0.1.zip");
using (new UseDialogOnce(ie.DialogWatcher, fdHandler))
{
// Get the download link
Link l = ie.Link(Find.ByText("LicenseAdder-v1.0.1.zip"));
l.ClickNoWait();
fdHandler.WaitUntilFileDownloadDialogIsHandled(60);
fdHandler.WaitUntilDownloadCompleted(2000);
ie.WaitForComplete();
}
ie.GoTo(@"http://www.google.com");
if (ie.Url != @"http://www.google.com")
{
MessageBox.Show("Error URL is set to: " + ie.Url + " instead of http://www.google.com!");
}
Best Regards,
Peter