javascript-如何在量角器中识别此元素?
作者:互联网
查看一些客户信息时,我看到底部显示了客户信息.我相信它来自JSON调用.
如何识别这个元素?我尝试了className,但无法正常工作.谢谢你的帮助.并尝试了此CSS. .override-info隐藏移动ng-scope.我需要断言与John Grish匹配的名称:
<div class="override-info hide-mobile ng-scope" ng-if="overrideCustInfo">
<p class="override-info-title">You are viewing</p>
<p class="override-info-dtl ng-binding">John Grish</p>
<p class="override-info-dtl ng-binding">1177 Montogomery st</p>
<p class="override-info-dtl ng-binding">San Francisco, CA</p>
</div>
解决方法:
您可以依靠类名:
expect(element
.all(by.css("div.override-info p.override-info-dtl"))
.first().getText()
).toEqual("John Grish");
标签:selenium,testing,protractor,end-to-end,javascript 来源: https://codeday.me/bug/20191120/2043006.html