I have a search field with results powered by ElasticSearch and I am automating the selecting of one of the results. CSS and XPath do not yield very much in terms of selecting the element and clicking it so I am hoping for some help.
Code:
li data-ng-repeat="match in matches" data-ng-class="{active: isActive($index) }" data-ng-mouseenter="selectActive($index)" data-ng- click="selectMatch($index)" class="ng-scope active">
<a tabindex="-1" class="bg-info ng-scope">
<div class="search-item-container row">
<div class="col-sm-10">
<span class="company-name ng-binding" bind-html-unsafe="match.model.name.length > 30 ? (match.model.name.substr(0,30) + '...').toLowerCase() : match.model.name.toLowerCase() | typeaheadHighlight:query"><strong>alph</strong>, incorporated</span>
<div class="company-info">
<address>
<span class="address-span-container ng-isolate-scope" data-ng-switch="displayFormat" data-obb-address-display-directive="" data-addresses="match.model.addresses" data-display-format="inlineCsz"
Using Protractor my selector would be:
element(by."some selector"(item to select))).click();
I've tried both CSS and Xpath and the results are:
NoSuchElementError: No element found using locator: By.cssSelector(".search-popup li:nth-child(3) a")