address: {address1: this.myAddress1, address2: this.myAddress2, address3: this.myAddress3, address4: this.myAddress4}
我已经尝试过定位器
<h5 class="val ng-binding">
Machine states
<div class="dashboard-arrow fa fa-arrow-right"></div>
July 9, 03:24 To July 9, 11:24
</h5>
,但我没有在h5标记中得到所有文本,我该如何得到它?我想念什么?
答案 0 :(得分:0)
最好像这样使用contains() XPath Function
//h5[contains(text(),'Machine states')]
如果要获取<h5>
tag内的所有文本,请输入innerText
property
driver.findElementByXPath("//h5[contains(text(),'Machine states')]").getAttribute("innerText")
演示: