Protractor Drugator by.repeater如何查找同级元素

Protractor Drugator by.repeater如何查找同级元素,protractor,Protractor,我想用class=“dropdown item icon ctp img notification error” 我怎么能得到这个 在这种情况下,我只需要文本“无法加载数据”,因为这是一个错误 我的第一个想法是: var errorMessages=[]; 元素.all(by.css('.dropdown-item-icon.ctp-img-notification-error.ng binding'))。然后(function(items){ items.forEach(功能(项目){ i

我想用
class=“dropdown item icon ctp img notification error”

我怎么能得到这个

在这种情况下,我只需要文本“无法加载数据”,因为这是一个错误


  • 我的第一个想法是:

    var errorMessages=[];
    元素.all(by.css('.dropdown-item-icon.ctp-img-notification-error.ng binding'))。然后(function(items){
    items.forEach(功能(项目){
    item.getText().then(函数(消息){
    错误消息。推送(消息);
    });
    }); 
    });
    
    这将为我提供错误图标div,其中我需要消息div(ng绑定)。我希望消息包含在带有ng binding类的Div中,同时也存在错误图标,并且仅在这些情况下。我通过在css选择器中添加“.ng binding”作为子级来编辑我的答案。现在能用了吗?