Page 1 of 1

Problems with webdocument.Navigate()

Posted: Wed Oct 12, 2011 11:48 am
by Todor
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?

Re: Problems with webdocument.Navigate()

Posted: Wed Oct 12, 2011 1:25 pm
by Support Team
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

Re: Problems with webdocument.Navigate()

Posted: Wed Oct 12, 2011 2:02 pm
by Todor
That did the trick, thanks very much. :)