Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to view PhantomJS console.log messages via Selenium/GhostDriver?

I'm using the Java bindings of GhostDriver to run Selenium acceptance tests against PhantomJS.

If one of the web pages requested by PhantomJS logs to the Javascript console via console.log, is there a way to capture or view those messages?

I'm guessing that the answer to this is forehead-slappingly simple but I can't work it out!

like image 997
kelveden Avatar asked Oct 07 '13 12:10

kelveden


1 Answers

LogEntries logs = driver.manage().logs().get("browser");
like image 157
lukeis Avatar answered Sep 27 '22 23:09

lukeis