【发布时间】:2019-02-23 05:40:20
【问题描述】:
<input _ngcontent-c6="" formcontrolname="password"
name="password" onblur="this.placeholder = 'Password'"
onfocus="this.placeholder = ''"
placeholder="Password"
required="" type="password"
ng-reflect-required="" ng-reflect-name="password"
class="ng-pristine ng-invalid ng-touched">
查找元素的最佳方法是:placeholder = "Enter Username"?
场景:使用上面的 Snippet 查找元素 用户点击"Enter Name" 框,弹出另一个输入名称的窗口。
【问题讨论】:
-
css 选择器:
input[placeholder="Password"] -
HTML 指的是
placeholder="Password",问题提到了placeholder = "Enter Username",在场景中你提到了"Enter Name"。你的确切用例是什么?
标签: angularjs selenium testing protractor placeholder