I have searched on Google and the SO site and I get answers for JAVA but do not seem to get answers for node.js
I have a web app that takes time to load. I would like
Try something like this:
function isItThere(driver, element){
driver.findElement(webdriver.By.id(element)).then(function(webElement) {
console.log(element + ' exists');
}, function(err) {
if (err.state && err.state === 'no such element') {
console.log(element + ' not found');
} else {
webdriver.promise.rejected(err);
}
});
}
I adapted it slightly based on what I found here: Check if element exists - selenium / javascript / node-js and it worked a charm.