How to pass data from the “then” methods in CasperJS?
It's common to have multiple then methods when working with CasperJS. The following is an example: casper.then(function(){ var a = "test"; // ... }) casper.then(function(){ // how to use the variable a in the first "then" }) My question is, what's the common way to pass values from former then s to following then s? For the aforementioned example, how to use a in the second then ? There are many way, but the easiest would be to use global variables. If you don't want to clutter your scripts with global variables (which should not be of the same concern as global variables in the browser,