I\'m setting some capabilities for PhantomJsDriver
.
DesiredCapabilities caps = new DesiredCapabilities();
caps.setJavascriptEnabled(true);
caps.
With phantomjsdriver-1.1 I had to pass the follow arguments to get this to work.
cliArgsCap.add("--web-security=no");
cliArgsCap.add("--ignore-ssl-errors=yes");
PhantomJS uses different mechanism in setting capabilities
static ArrayList<String> cliArgsCap = new ArrayList<String>();
capabilities = DesiredCapabilities.phantomjs();
cliArgsCap.add("--web-security=false");
cliArgsCap.add("--ssl-protocol=any");
cliArgsCap.add("--ignore-ssl-errors=true");
capabilities.setCapability("takesScreenshot", true);
capabilities.setCapability(
PhantomJSDriverService.PHANTOMJS_CLI_ARGS, cliArgsCap);
capabilities.setCapability(
PhantomJSDriverService.PHANTOMJS_GHOSTDRIVER_CLI_ARGS,
new String[] { "--logLevel=2" });
this.driver = new PhantomJSDriver(capabilities);
For more information about its command line, you could reference http://phantomjs.org/api/command-line.html