stepTImeout is not working

27 views
Skip to first unread message

Chan Oak

unread,
Oct 20, 2016, 1:44:06 PM10/20/16
to CasperJS
it seems stepTImeout is not working

I'm using

var casper = require('casper').create({
    verbose: true,
    loglevel: "debug",
    stepTimeout: 30000,
 onStepTimeout: function(self,m) {
     console.log('timeout: step' + m);
     this.echo("reloading");
        this.reload(function() {
            this.echo("loaded again");
        });
 },
    onWaitTimeout: function(self,m) {
     console.log('timeout: step' + m);
     this.echo("reloading");
        this.reload(function() {
            this.echo("loaded again");
        });
    }
});

as I'm watching the script run, the timeout message pops not even reached 30 sec, sometime it pops up twice continually.
and it shows reloading but does not show loaded again message, so I assume it didn't reload

Maybe I misunderstood about step timeout and steps.
Isn't steptimeout for every casper.then steps?

Can someone explain this?

and in waitforselector function, it seems the function execution for success never executes.

casper.waitForSelector(selector, function success() {
    this.echo('found links');
}, function timeout(){
    this.echo("reloading");
    this.goto("timeoutloop2");
}, 20000);

it seems function timeout is executing but not function success.

This is my second question.
Can someone also explain this also?

Thanks

Chan Oak

unread,
Oct 21, 2016, 7:12:02 AM10/21/16
to CasperJS
Turns out waitforselector timeout is not working either

casper.waitForSelector(selector, function success() {
    this.echo('found links');
}, function timeout(){ 
    this.echo("reloading");
    this.goto("timeoutloop2");
}, 5000);

I counted time, but either of function executes after 5 sec

and I'm using goto script with casperjs

Chan Oak

unread,
Oct 21, 2016, 4:40:57 PM10/21/16
to CasperJS
It turns out, yotsumoto goto script makes casperjs mal-function
thenOpen, onsteptimeout, also become malfunction with yotsumoto goto script 

Ken

unread,
May 25, 2017, 7:02:33 PM5/25/17
to CasperJS
Hi Chan Oak, thanks for always updating with your solution and others can learn from your findings. I'm a CasperJS user for couple of years. Looking through old issues in the mailing list and the GitHub repo issues.
Reply all
Reply to author
Forward
0 new messages