How to add PhantomJSDriver command line arguments [duplicate]

风格不统一 提交于 2019-12-11 04:03:01

问题


How can I specify command line arguments for my Java PhantomJSDriver? For example, I want to set --ignore-ssl-errors=yes on the script that I run.


回答1:


Simply add to phantomJS's default desired capabilities, like so:

DesiredCapabilities desiredCapabilities = DesiredCapabilities.phantomjs();
desiredCapabilities.setCapability("phantomjs.cli.args", Collections.singletonList("--ignore-ssl-errors=yes"));

PhantomJSDriver driver = new PhantomJSDriver(desiredCapabilities);


来源:https://stackoverflow.com/questions/31721486/how-to-add-phantomjsdriver-command-line-arguments

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