Verify Not Empty

I would like to verify the text content of an element is not empty. In other words, that it contains one or more characters.

This is possible with a coded solution. The example below is against this W3Schools site.

HtmlTable table = Find.ByTagIndex<HtmlTable>("table", 0);
HtmlTableRow row = table.Rows[0];
HtmlTableCell cell = row.Cells[1];

Assert.IsTrue(cell.TextContent.Length > 0);
Dim table As HtmlTable = Find.ByTagIndex(Of HtmlTable)("table", 0)
Dim row As HtmlTableRow = table.Rows(0)
Dim cell As HtmlTableCell = row.Cells(1)

Assert.IsTrue(cell.TextContent.Length > 0)
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article