'Page should contain' in the Browser library

Hi,

Which keyword in the Browser library do the same as the selenium library keyword ‘Page should contain’?

Thanks

Well there are multiple ways to do this. But I think the easiest way is the following:

Get Element count :text("The visible text that your page should contain"):visible > 0

The :text() pseudo-class matches the smallest element containing specified text. Matching is case-insensitive, trims whitespace and searches for a substring.
The :visible pseudo class makes sure that only visible elements are found.

3 Likes

In addition to falcon030 reply, I often use

Wait For Elements State selector visible timeout=(short timeout)
or
Get Element States selector validate value & visible

thanks @falcon030 @RysZ i used Get Element States selector contains attached ( i used attached to verify if the element is not visible it may exist in the DOM)