PhantomJSDriver works for HTTP but not for HTTPS

后端 未结 1 1292
鱼传尺愫
鱼传尺愫 2021-01-23 13:22
public class FooTest {
    WebDriver driver;

    @Before
    public void beforeTest() {
        DesiredCapabilities capabilities = new DesiredCapabilities();
        ca         


        
相关标签:
1条回答
  • 2021-01-23 14:02

    PhantomJSDriver does not support (all) DesiredCapabilities.

    You will need:

    caps = new DesiredCapabilities();
    caps.setJavascriptEnabled(true);
    caps.setCapability(PhantomJSDriverService.PHANTOMJS_CLI_ARGS, new String[] {"--web-security=no", "--ignore-ssl-errors=yes"});
    driver = new PhantomJSDriver(caps);
    

    Documented here: https://github.com/detro/ghostdriver/issues/233

    0 讨论(0)
提交回复
热议问题