Created
July 31, 2015 13:51
-
-
Save hassansin/9a5cddbd96190f767a66 to your computer and use it in GitHub Desktop.
CasperJS onComplete called infinitely when exitOnError is false.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var casper = require('casper').create({ | |
viewportSize: { | |
width: 1024, | |
height: 768 | |
}, | |
pageSettings: { | |
webSecurityEnabled: false | |
}, | |
exitOnError: false, | |
waitTimeout: 70000 | |
}); | |
casper.on('error',function(msg, trace){ | |
casper.bypass(casper.steps.length); | |
casper.thenOpen('http://yahoo.fr/', function() { | |
this.echo("Now I'm in your yahoo.") | |
}); | |
casper.run(function(){ | |
console.log('onComplete 2') | |
}); | |
}); | |
casper.start('http://google.fr/'); | |
casper.then(function(){ | |
throw new Error('dummy error'); | |
}); | |
casper.run(function(){ | |
console.log('onComplete 1') | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment