1
我想验证了这样的代码通知消息的文本:如何验证notify.js警报硒
<div class="notifyjs-corner" style="top: 0px; left: 45%;">
<div class="notifyjs-wrapper notifyjs-hidable">
<div class="notifyjs-arrow" style=""/>
<div class="notifyjs-container" style="">
<div class="notifyjs-bootstrap-base notifyjs-bootstrap-success">
<span data-notify-text="">Payment Created Successfully</span>
</div>
</div>
</div>
</div>
我的硒代码:
String notify = BrowserSetup
.driver
.findElement(By.xpath("//span[contains(.,
'Payment Created Successfully')]"))
.getText();
System.out.println(notify);
价值在String notify
是空的。
问题
我怎样才能得到通知的文字?
参考:notify.js
一次尝试为:'BrowserSetup.driver.findElement(By.cssSelector(“div中。 “))。getText();'让我知道.. :) –
这是抛出没有这样的元素例外 –
你能告诉我什么时候这个警报变成visibl è?? –