Do not swear strongly if such a question has already been, but I searched and came across this solution:
List<WebElement> list1 = (List<WebElement>) d.findElements(by.classname("item-list-entry ng-scope"));
list1.get(2).click();
I write to Java, and I try to parse the list, go through it and click on the 3rd element. Unfortunately, it does not help me.
The structure of my html
<div id="search-results" class="row search-result">
<div class="col-sm-12 col-wog">
<div class="item-list-entry ng-scope" ng-if="currentSearchOptions.display =='item-list'">
<div class="row ng-scope" ng-repeat="entry in searchResults">ITEM 1 </div>
<div class="row ng-scope" ng-repeat="entry in searchResults">ITEM 2 </div>
<div class="row ng-scope" ng-repeat="entry in searchResults">ITEM 3</div>
<div class="row ng-scope" ng-repeat="entry in searchResults">ITEM 4 </div>
</div>
</div>
</div>
I need the 3rd item. My decision before was simple (xpath)
//*[@id="search-results"]/div/div[1]/div[3]/div[2]/div[3]/p