I am having problems with pages with SSL. I'm pretty sure this is the problem because I can go to http pages and get the full page source, but when I go to an https address, I get the following:
<html><head></head><body></body></html>
I am using:
- PhantomJS v. 1.9.1
- GhostDriver v. 1.0.3
- Java 1.7
I have tried setting --ignore-ssl-errors=true on desired capabilities, but it doesn't seem to be working.
public WebDriver createDriver(DesiredCapabilities dcaps) {
dcaps.setCapability(
PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY,
"target/classes/phantomjs.exe");
String [] phantomJsArgs = {"--ignore-ssl-errors=true"};
dcaps.setCapability(
PhantomJSDriverService.PHANTOMJS_GHOSTDRIVER_CLI_ARGS,
phantomJsArgs);
return new PhantomJSDriver(dcaps);
}
I have also tried this with "PhantomJSDriverService.PHANTOMJS_CLI_ARGS" and with the cli argument "--web-security=false" added. In all cases, I can see something like the following in the console, but none seem to actually work.
DEBUG: org.apache.http.wire - >> "{"desiredCapabilities":{
"loggingPrefs":{"driver":"FINEST"},"cssSelectorsEnabled":true,
"javascriptEnabled":true,"phantomjs.ghostdriver.cli.args":["--ignore-ssl-errors=true"],
"phantomjs.binary.path":"target/classes/phantomjs.exe",
"takesScreenshot":true}}"
Any ideas would be greatly appreciated.