Please allow me to share some details about Test Studio and how it reads the DOM tree. The table that you see in the page has a number of rows that are visible in the browser. The code that you have shared works against "mytable" element and checks all available rows that are loaded in the DOM tree. I assume that the table has paging and this is why some of the rows do not exist in the DOM and are not visible in this page.
Depending on the application and the table that it contains, you can try different approaches, like:
- inspecting the table control for an element that shows the total number of rows (see the bottom right corner of the sample Kendo grid here
). Some control expose this information and you should be able to get this value and verify it;
var items = Pages.xxxx.x120Of91Span.TextContent;
Log.WriteLine("items " + items.Substring(10, 2));
- finding all elements with a specific tag, like "tr", in the specific table element and check the number. This approach will only work if all rows are present in the DOM tree of the page;
var tags = Pages.xxxx.mytable.Find.AllByTagName("tr");
Log.WriteLine("all tags " + tags.Count);
- checking calculating the number of rows based on the number of pages and the elements per page. To do that, you need to check the number of rows in a full page and the number of pages. Please keep in mind that the last page might contain less rows than the others.
I hope that the above details will help you with this scenario. If you continue to experience any troubles, please share a sample of the table and share more details.