Sto usando waitFor()
. Il codice, come di seguito:Come aumentare il timeout in CasperJS
casper.waitFor(function check() {
return this.evaluate(function() {
return this.evaluate(someFunction, 'variable 1','variable 2','variable 3') === 'yes';
});
}, function then() {
console.log('Done');
});
sono sempre questo come uscita della console
Wait timeout of 5000ms expired, exiting.
Come è possibile aumentare il timeout?
EDIT: ho cambiato il codice per
casper.waitFor(function check() {
return this.evaluate(function() {
return this.evaluate(someFunction, 'variable 1','variable 2','variable 3') === 'yes';
});
}, function then() {
console.log('Done');
},10000);
E mi sta dando il seguente errore:
CasperError: Invalid timeout function, exiting.
C:/filename:1720 in _check
È anche possibile impostare un'opzione per aumentare il timeout. Questo sarà l'impostazione predefinita per tutte le funzioni a tempo. Vedere il seguente link: [collegamento] (http://docs.casperjs.org/en/latest/modules/casper.html#timeout) – Ryguy
Vedere Modifica. Ho aggiornato il codice ma sto ricevendo l'errore come mostrato nella modifica – user2129794
sì, infatti il terzo argomento è il callback Timeout. Il valore di timeout è il quarto. – Cybermaxs