我正在使用量角器js进行测试。在这里,我想点击表格行内的删除按钮,但当我尝试通过id找到时,我无法找到它。
代码:
it('should delete the batch successfully when admin is logged in', function(){
element(by.repeater('batch in batches.list').row(0)).element(by.id('delete')).click();
ptor.sleep(500);
ptor.actions().sendKeys(protractor.Key.ENTER).perform();
}
错误:
1) Batch modal should delete the batch successfully when admin is logged in
Message:
Error: No element found using locator: by.repeater(batch in batches.list").row("0")"
我怎样才能让它发挥作用。有人可以提供建议吗?
答案 0 :(得分:0)
这里我没有发送延迟,所以我正在检查未加载的按钮 ptor.sleep(500);解决了我的问题。花了很多时间来确定