Protractor find element inside a repeater

后端 未结 5 1698
南笙
南笙 2020-12-09 16:06

Below is my markup


  {{post.title}}
  <         


        
5条回答
  •  半阙折子戏
    2020-12-09 16:46

    you have to find a element inside a array as explained here https://github.com/angular/protractor/issues/877

    var items = element.all(by.repeater('userGroup in userGroups')).filter(function(item) {
         return item.element(by.binding('userGroup.name')).getText().then(function(label) {
               return label === 'MyGroupName';
         });
      });
    items.get(0).element(by.css('.buttongochose')).click();
    

提交回复
热议问题