This question already has an answer here:
-
Why won't PhantomJSDriver use the capabilities I set?
2 answers
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.
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);