I am running casper script via node using child_process execFile function, passing some data cli params.. But when i run the script i couldn't able to store those cli opts into variable for using them..
var casper = require("casper").create();
casper.echo("Casper CLI passed options:");
require("utils").dump(casper.cli.options);
// I want those all dumped data into single variable i.e., object but couldn't able to
// var options1 = require("utils").dump(casper.cli.options);
// var options2 = casper.cli.options;
casper.exit();
Here is the logs:
['Casper CLI passed opts:\n',
'{\n "page": 1,\n "store": "Hello",\n "title": "Flex App"\n}]
How can i achieve this?
I've found that i wasn't able to store those cli opts into variables but can get the params values using
casper.cli.get(index)
and use as much i want it to use it (within that script).. this solved my case without storing into variables..
Hope this may help others when they come over here.
Cheers,