我有這樣一個DOM:無法找到一個方法來挖掘()這個元素(WD,的NodeJS)
<form id="frmResendPassword" role="form" method="post">
<div class="form-group">...</div>
<span class="pull-right">
<button type="submit" class="btn btn-sm btn-default">
Resend Password</button>
</span>
</form>
我想輕按「重新發送密碼」按鈕。
我已經嘗試了許多不同的選擇,如:
elementByClassName("btn-default")
elementById("frmResendPassword")
elementByName("Resend Password")
elementByCss(thecsspath)
ECT ....他們沒有執行tap()
... 但是他們不扔一個元素沒有發現錯誤.... 所以我很困惑。可有一個人請幫助
更新: 下面是基本的自動化代碼...它非常基本
it("should send text to phone", function(){
sleep.sleep(5)
return browser
.elementByName("mobileNo")
.sendKeys(usrnme)
.elementByCss("#frmResendPassword button[type=submit]")
.tap()
})
這類型的細手機號碼,但它似乎忽略按下按鈕。
?什麼是'thecsspath'?除了'elementByClassName(「btn-default」)'',你的其他選擇器抓取了錯誤的元素,但是這也可能抓住不同的按鈕。 – mrfreester