
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();
}
}