Hello,
I have a problem finding specific tag, which occurs only once. For example:
HTML code excerpt:
<table class="table" id="users-table">
<tbody>
<tr class="ng-scope" ng-click="user.id" ng-repeat="user in vm">
</tr>
</tbody>
</table>
Coded step used on HTML code above:
Manager.ActiveBrowser.RefreshDomTree();
IList<HtmlControl> allUsers = Find.AllByXPath<HtmlControl>("table[@id='users-table']/tbody/tr");
int maxCount = allUsers.Count;
Log.WriteLine("Found: " + maxCount.ToString() + " elements.");
Problem that I'm facing:
If I run above coded step it returns maxCount = 0! Instead it should return 1, because one tr tag is available and can be found. If I use online XPATH validators they all return one result (one example of such validator http://codebeautify.org/Xpath-Tester). Let me know why this is happening and how can I solve this? If you have another idea how to solve my problem, please do let me know.
BR, Jurij