Answer the question
In order to leave comments, you need to log in
Nightmare forced to stop?
I have code like this how to stop running when
if(window.document.querySelector('#validate') === null)
nightmare.goto('https://').wait(2000)
.evaluate(() => {
if(window.document.querySelector('#validate') === null)
{
return this.end();
}
})
.type('#validateInput', 'Hello World!')
.click('#validateButton')
.wait(2000)
.end()
.catch(e => {
console.error(e);
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question