I know this question has been asked and answered, but either I'm not understanding how to address my specific situation, or I am asking for something slightly different.
I have a scripted test that looks for specific text on screen, and if it does find that text, the test will Log.WriteLine and continue on with the test. What I would also like to happen, is for the test to be marked with a rex X as a fail, but still continue on with the test.
If I could please get some assistance, that would be great.
I have a scripted test that looks for specific text on screen, and if it does find that text, the test will Log.WriteLine and continue on with the test. What I would also like to happen, is for the test to be marked with a rex X as a fail, but still continue on with the test.
If I could please get some assistance, that would be great.
foreach
(HtmlAnchor Reports
in
creativeReportsAnchors)
{
try
{
Log.WriteLine(Reports.HRef);
Reports.Click();
//Refresh DOM tree
System.Threading.Thread.Sleep(7000);
ActiveBrowser.RefreshDomTree();
if
(ActiveBrowser.ContainsText(productionError) ==
true
)
{
Log.WriteLine(
"ERROR: "
);
}
else
if
(ActiveBrowser.ContainsText(stagingError) ==
true
)
{
Log.WriteLine(
"ERROR: "
);
}
System.Threading.Thread.Sleep(2000);
}
catch
(Exception)
{
}
finally
{
ActiveBrowser.NavigateTo(CurrentSiteUrl +
"reports-creative.aspx"
);
}
}