0
頁
上我已經試過這樣:硒的webdriver:等到文本存在
driver.wait(function() {
return driver.isElementPresent(webdriver.findElement(By.xpath("//*[contains(text(),'Vanilla Sky Final Scene')]")))
}, 20000).then(function() {
console.log('worked')
})
這:
driver.wait(function() {
return driver.isElementPresent(driver.findElement(By.xpath("//*[contains(text(),'Vanilla Sky Final Scene')]")))
}, 20000).then(function() {
console.log('worked')
})
這:
driver.wait(function() {
return driver.findElement(By.xpath("//*[contains(text(),'Vanilla Sky Final Scene')]")))
}, 20000).then(function() {
console.log('worked')
})
他們似乎都不上班。什麼是正確的做法?
我想你的意思'isDisplayed()' - 我會編輯,但是我只需要編輯一個字符,SO最小編輯是6個字符:) – JoeyC
感謝糾正它。 –