In the page I\'m testing, two buttons may be displayed: BASIC or ADVANCED.
I want to be able to tell if the ADVANCED button is showing -- and if so, click it.
<
The syntax could be little off. Not very familiar with NightWatchJS. However the concept remains same.
//I would not wait for a element that should not exist
//rather I would find the list of the element and see if the count is greater than 0
//and if so, we know the element exists
browser.findElements(webdriver.By.css('#advanced-search')).then(function(elements){
if(elements.length> 0){
console.log(elements.length);
}
});
See some more example here