Html code
<li name="choice" ng-repeat="choice in candidateStatus" ng-if="choice!=member.candidate_status.status" ng-click="setStatus(choice, member)" class="ng-binding ng-scope">Shortlisted</li>
It is giving the error
ElementNotVisibleError: element not visible
I tried to scroll down the page using this code but it is not working.
browser.executeScript('window.scrollTo(0,250);');
Please please help me
Try scrolling the page by getting the location of the element and then wait until scroll happens before clicking on the element using promise that executeScript()
function returns. Here's how to do it -
var ele = element(by.repeater('choice in candidateStatus'));
ele.getLocation()
.then(function(loc){
browser.executeScript('window.scrollTo(0,'+loc.y+');')
.then(function(){
ele.click();
});
});
If there are multiple list elements with ng-repeat
tag, then you should probably get the particular list element before clicking it.
Hope this helps.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments