ChromeDriver disable rendering and CSS

老子叫甜甜 提交于 2019-12-08 08:10:29

问题


I want to run high performance tests on chrome driver. They still require execution of javascript. But rendering the page and executing/parsing css, is just not necessary and a waste of time. How can I prevent chromedriver from rendering and/or loading the css? Run it fully headless.

I am aware of HTMLUnit as an alternative but it is extremely slow, and does terrible job with the javascript.

I did find Phantom Driver https://github.com/qa/arquillian-phantom-driver and I tested it but I would prefer to stick with chrome due to the extensions and amazing support I can find for it.


回答1:


Chrome/chromedriver cannot run headless without some virtual screen like Xserver, and it can't not-render the html and css.



来源:https://stackoverflow.com/questions/37491778/chromedriver-disable-rendering-and-css

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