I have one page in my casperjs test that has images , I dont what to wait until this page loaded to go to the next step. How can I do it ? I have tryed this way
<
Indeed, in some cases a CasperJS's step can occasionally expire by timeout (if stepTimeout
is specified in the settings) due to problems with connection. Default behaviour is to stop CasperJS by this.die
. If it's required to not stop CasperJS, but rather continue executing next steps, one should provide a custom onStepTimeout
. Unfortunately, request.abort
is not defined in this context, because request
is only accessible inside onResourceRequested
handler (this is why the answer of @Topher Ellis is questionable). In other words, request.abort
is useful to prevent a new request from being issued, but can not stop a request which is already in progress (and can be potentially timed out). For such situations I'm using the following code:
var casper = require("casper").create(
{
...
onStepTimeout: function(timeout, step)
{
this.echo('step timeout');
this.clear();
this.page.stop();
}
});
Hope this helps.