I am using waitFor()
. The code as below:
casper.waitFor(function check() { return this.evaluate(function() { return this.evaluate(someFunction, 'variable 1','variable 2','variable 3') === 'yes'; }); }, function then() { console.log('Done'); });
Am getting this as console output
Wait timeout of 5000ms expired, exiting.
How can I increase the timeout?
EDIT: I have changed the code to
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);
It's giving me the following error:
CasperError: Invalid timeout function, exiting. C:/filename:1720 in _check
Use that to increase the timeout of every wait() functions : casper.options.waitTimeout = 20000;
(20sec)
As said here,
The signature is
waitFor(Function testFx[, Function then, Function onTimeout, Number timeout])
So, there is an additionnal argument to specify the timeout.
casper.waitFor(function check() { //... }); }, function then() { //... }, function timeout() { //... }, TIMEOUT_IN_MS);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With