Hi,
I am trying to check a condition on the failed webpage using Htmlspan label text. The application requires moving from one webpage to another webpage and perform certain actions on the webpage and the loop continues for several webpages. When i record the failed webpage i get the below lines of code which i am trying to use this in my if else condition. The issue which i am facing is that it works for the first error webpage and moves to the second webpage. When the second webpage fails i am getting an error. The condition is not able to get the failed template HtmlSpan label text and moving to the else condition. (FYI. All the failed webpages pick the text content from the same HtmlSpan i.e same error page loads everytime when ever a page fails).
It would be very helpful if you could suggest me a proper approach to achieve this.
Regards,
Santosh
I am trying to check a condition on the failed webpage using Htmlspan label text. The application requires moving from one webpage to another webpage and perform certain actions on the webpage and the loop continues for several webpages. When i record the failed webpage i get the below lines of code which i am trying to use this in my if else condition. The issue which i am facing is that it works for the first error webpage and moves to the second webpage. When the second webpage fails i am getting an error. The condition is not able to get the failed template HtmlSpan label text and moving to the else condition. (FYI. All the failed webpages pick the text content from the same HtmlSpan i.e same error page loads everytime when ever a page fails).
It would be very helpful if you could suggest me a proper approach to achieve this.
Regards,
Santosh
Pages.Online7.FrameNavigationPanel.LblErrorTitleSpan.AssertContent().TextContent(ArtOfTest.Common.StringCompareType.Contains,
"Sorry there was an error displaying your report."
);
or
Pages.Online7.FrameNavigationPanel.LblErrorTitleSpan.BaseElement.Wait.ForCondition((a_0, a_1) => ArtOfTest.Common.CompareUtils.StringCompare(a_0.TextContent,
"Sorry there was an error displaying your report."
, ArtOfTest.Common.StringCompareType.Contains),
false
,
null
, 10000);
if
(Pages.Online7.FrameNavigationPanel.LblErrorTitleSpan.IsEnabled)
or
if
(Pages.Online7.FrameNavigationPanel.LblErrorTitleSpan.IsVisible())
{
Code to move to next webpage
Pages.Online4.ImgRightArrow.Click(
false
);
}
else
{
Some Code to perform actions on the rendered webpage
}