phantomjs: is there a console or log to see what is going on internally?

Funny one, to us....

We drive phantom from python -> selenium.

Since phantom is non visual, we have no idea what is going on during a test.

We wonder: Is there :

We are looking for high level info. Like:

etc

Upvotes: 2

Views: 2857

Answers (2)

zhm
zhm

Reputation: 3651

You can add --remote-debugger-port=9000 and --remote-debugger-autorun=true options when start phantomjs. Then open browser and navigate to http://localhost:9000, you will see phantomjs remote debugger console. It's like Chrome console.

NOTE:

Console can be opened in browser, only if there is a web page opened in phantomjs. Following code can be used to open page:

var page = require('webpage').create();
var url = 'http://github.com';

page.open(url, function() {
    // do something...
});

Upvotes: 1

omri_saadon
omri_saadon

Reputation: 10631

You can set the service_log_path. It should save the log of phantomjs. The example here uses the splinter library, Although you can do the same with selenium.

browser = Browser('phantomjs', service_log_path='/var/log/ghostdriver.log')

Upvotes: 0

Related Questions