Type a URL, for example a document in docs.google.com
Click Go
Press Return to dismiss the alert
Click stop recording
click export CasperJS
Close the tab with the export code
Repeat the steps above quickly without refreshing the page or pausing
Sometimes (about 10% of the time) this produces mangled code because the .start() call is missing. This is easier to reproduce with cache cleared, on sites with a heavy amount of javascript running, after following the steps above more than once in a row.
See snippet below for an example of a mangled export
//==============================================================================
// Casper generated Mon Mar 17 2014 16:27:11 GMT-0400 (Eastern Daylight Time)
//==============================================================================
var x = require('casper').selectXPath;
casper.run(function() {test.done();});
});
Sometimes (about 10% of the time) this produces mangled code because the .start() call is missing. This is easier to reproduce with cache cleared, on sites with a heavy amount of javascript running, after following the steps above more than once in a row.
See snippet below for an example of a mangled export