New to Telerik Test Studio? Start a free 30-day trial
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.
Solution
This is possible with a coded solution. The example below is against this W3Schools site.
C#
HtmlTable table = Find.ByTagIndex<HtmlTable>("table", 0);
HtmlTableRow row = table.Rows[0];
HtmlTableCell cell = row.Cells[1];
Log.WriteLine(cell.TextContent);
Assert.IsTrue(cell.TextContent.Length > 0);