Menu

#276 GoTo not working properly after file download

Version_2.next
open
5
2014-08-28
2011-10-17
Peter P
No

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

Discussion


Log in to post a comment.

MongoDB Logo MongoDB