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

跟風遠走 提交于 2019-12-21 03:48:27

问题


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!


回答1:


LogEntries logs = driver.manage().logs().get("browser");


来源:https://stackoverflow.com/questions/19225532/is-there-a-way-to-view-phantomjs-console-log-messages-via-selenium-ghostdriver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!