Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

Does not run in debug mode because of missing casper module #23

Closed
marrs opened this issue Sep 16, 2013 · 2 comments
Closed

Does not run in debug mode because of missing casper module #23

marrs opened this issue Sep 16, 2013 · 2 comments

Comments

@marrs
Copy link

marrs commented Sep 16, 2013

I'm trying to run my testsuite.js in debug mode but am unable to do so because the casper module cannot be found. I presume this is because the debugger uses the context of the browser you run it in and so you lose access to the filesystem.

Steps to reproduce:

  1. From the terminal, run phantomjs --remote-debugger-port=9000 testsuite.js
  2. Navigate to http://localhost:9000 in a browser (I use Chrome)
  3. In the console, type __run()

An exception is thrown with message: cannot find module 'casper'.

It would be great to know how you guys go about debugging against PhantomJS.

@jamescryer
Copy link

It'll be interesting to find out if we can run PhantomCSS in remote-debugger, I haven't looked into it before.

As you say, PhantomJS has an inner scope (browser) and outer scope, looks like it's trying to evaluate Casper in the inner scope, which is wrong.

I only ever need to debug PhantomCSS when I'm updating it for some reason, this is normally limited to logging. For day-to-day test suite stuff we make good use of CasperJS's logging

http://docs.casperjs.org/en/latest/modules/casper.html#logging.html

These methods are particularly useful.

casper.on("remote.message", function(msg) {});
casper.on("page.error", function(){});
casper.on('error', function(e){});

Taking lots of screenshots also helps to be able to see whats going on.

casper.page.render('debug.png');

That said, debugging in PhantomJS has never been easy...

@jamescryer
Copy link

I'm closing this issue. Not sure if it still applies, probably a setup thing. FYI, https://github.com/Huddle/PhantomFlow supports remoting debugging, and wraps PhantomCSS.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants