I am using Selenium and PhantomJS to do integration testing on my web app.
When something goes wrong, how do I debug the Javascript?
Can I connect with Firefox Developer Tools using Valence?
Note: I already save a screenshot and the page source when the test fails. What I want to do now is set break points and step through the code.
You may be able to use node-inspector for that. However, I'd recommend using an actual browser for debugging. PhantomJS is a headless browser, and well suited for the job when you need a non-intrusive and fast browser, but otherwise I don't see any point in using it.
Just looked at the PhantomJS documentation, and found this:
Remote Debugging
Remote debugging permits inspection of the script and web page via another WebKit-based browser (Safari and Chrome). This is achieved by launching PhantomJS with the new option, as in this example
phantomjs --remote-debugger-port=9000 test.jsAfter that, open Safari/Chrome/Chromium and go to the URL http://ipaddress:9000. If you executed the phantomjs command on the same machine, it will be http://127.0.0.1:9000
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With