debugging - How to remote debug CasperJS with Chrome? -
debugging - How to remote debug CasperJS with Chrome? -
what steps debug casperjs scripts in chrome? i'm trying debug on windows 8.1.
1) test c:\temp\googletestin.js have:
debugger; casper.test.begin('google search retrieves 10 or more results',3, function suite(test) { casper.start("http://www.google.com.br/", function() { this.echo(">>number 1"); test.asserttitle("google", "title home page google"); casper.echo(">>number 2"); test.assertexists('form[action="/search"]', "find form search"); casper.echo(">>number 3"); this.fill('form[action="/search"]', { q: "casperjs" }, true); this.echo(">>number 4"); casper.capture('test.png', undefined, { format: 'png', quality: 75 }); }) casper.run(function() { test.done(); }); }); 2) open cmd.exe
3) command line
>casperjs test c:\temp\googletesting.js --remote-debugger-port=9222 --remote-debugger-autorun=yes ps: test running until end normally
4) open chrome , field url: http:localhost:9222
5) page blank
6) open console (f12) , do: __run(); nil happening
in step 3 need pass debugger options casperjs , not script accessible through casper.cli. should not allow script autostart (--remote-debugger-autorun=yes) otherwise run before can debug it. correctly stated, can open chrome/safari , phone call __run() trigger script execution.
casperjs --remote-debugger-port=9222 test yourscript.js google-chrome debugging phantomjs remote-debugging casperjs
Comments
Post a Comment