简体   繁体   English

如何在量角器中识别这个元素?

[英]How to identify this element in protractor?

When I view some customer information, I see the customer information displayed at the bottom. 当我查看一些客户信息时,我看到底部显示的客户信息。 I believe it comes from JSON call. 我相信它来自JSON调用。

How to identify this element? 如何识别这个元素? I tried className but not working. 我尝试了className但没有工作。 Thanks for your help. 谢谢你的帮助。 And tried this css as well. 并尝试了这个CSS。 .override-info hide-mobile ng-scope . .override-info hide-mobile ng-scope I need to assert the name matches to John Grish : 我需要声明匹配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>

You can rely on class names: 你可以依赖类名:

expect(element
    .all(by.css("div.override-info p.override-info-dtl"))
    .first().getText()
).toEqual("John Grish");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM