Problems with webdocument.Navigate() : General Questions

Problems with webdocument.Navigate()

Ask general questions here.

Problems with webdocument.Navigate()

Postby Todor » Wed Oct 12, 2011 12:48 pm

Hey :)
I have a problem with webdocument.Navigate(). I want to refresh a webpage until the Email i sent before is shown on the page. Here is my Code:

Code: Select all
private void LookForEntry()
        {
           bool IsFound = false;
           int counter = 0;
           
           Delay.Duration(1000);
           webDocument.Navigate( Website + "/Lists/Tickets/AllItems.aspx");
           webDocument.WaitForDocumentLoaded();
           Delay.Duration(1000);
           
           try
           {
              Delay.Duration(1500);
              BodyTag x = "/dom/body/";
              ((ATag)x.FindSingle(".//a[@innertext='" + Subject + "']")).Click();
              IsFound = true;
           }
           catch (Exception ex)
           {
              if (counter <= 9)
              {
                 counter++;
                 Report.Log(ReportLevel.Info, "" + ex.ToString() + "");
                 LookForEntry();
              }
              else if (counter == 10)
              {
                 throw new Exception("Es wurde leider nichts gefunden!");
              }
           }
           
           if (IsFound == true)
           {
              SendReply();
           }
                  
        }


I dont know why but the webDocument.Navigate( Website + "/Lists/Tickets/AllItems.aspx"); in the fifth row doesnt refresh the webpage it just opens a new tab in the IE. What am i missing here?
Todor
 
Posts: 66
Joined: Mon Jul 25, 2011 12:28 pm

Re: Problems with webdocument.Navigate()

Postby Support Team » Wed Oct 12, 2011 2:25 pm

Hi,

I tried it by myself but haven't had this issue with WebDocument.Navigate.
If you just want to reload your page you can use following code instead:
webDocument.ExecuteScript("location.reload()");


Kind regards,
Tobias
Support Team
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: Problems with webdocument.Navigate()

Postby Todor » Wed Oct 12, 2011 3:02 pm

That did the trick, thanks very much. :)
Todor
 
Posts: 66
Joined: Mon Jul 25, 2011 12:28 pm


Return to General Questions

Who is online

Users browsing this forum: No registered users and 0 guests