Firefox
//创建FirefoxProfile
FirefoxPrifile profile = new FirefoxProfile();
//点击继续浏览不安全的网站
profile.setAcceptUntrustedCertificates(true);
//使用带条件的profile去创建一个driver对象
WebDriver driver = new FirefoxDriver(profile);
Chrome
//创建DesiredCapabilities的对象
DesiredCapabilities cap = DesiredCapabilities.chrome();
//设置ACCEPT_SSL_CERTS变量值为true
cap.setCapability(CapabilityType.ACCEPT_SSL_CERTS,true);
//新建一个带capability的Chromedriver对象
WebDriver driver = new ChromeDriver(cap);