stepTImeout is not working

瀏覽次數:27 次
跳到第一則未讀訊息

Chan Oak

未讀,
2016年10月20日 下午1:44:062016/10/20
收件者: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

未讀,
2016年10月21日 清晨7:12:022016/10/21
收件者: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

未讀,
2016年10月21日 下午4:40:572016/10/21
收件者:CasperJS
It turns out, yotsumoto goto script makes casperjs mal-function
thenOpen, onsteptimeout, also become malfunction with yotsumoto goto script 

Ken

未讀,
2017年5月25日 晚上7:02:332017/5/25
收件者: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.
回覆所有人
回覆作者
轉寄
0 則新訊息