本文整理汇总了Java中org.openqa.selenium.firefox.FirefoxProfile.setAssumeUntrustedCertificateIssuer方法的典型用法代码示例。如果您正苦于以下问题:Java FirefoxProfile.setAssumeUntrustedCertificateIssuer方法的具体用法?Java FirefoxProfile.setAssumeUntrustedCertificateIssuer怎么用?Java FirefoxProfile.setAssumeUntrustedCertificateIssuer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openqa.selenium.firefox.FirefoxProfile
的用法示例。
在下文中一共展示了FirefoxProfile.setAssumeUntrustedCertificateIssuer方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createWebDriver
import org.openqa.selenium.firefox.FirefoxProfile; //导入方法依赖的package包/类
@Override
public WebCommunicationWrapper createWebDriver(ProxyServerWrapper proxyServer)
throws WorkerException {
try {
Proxy proxy = proxyServer.seleniumProxy();
proxyServer.setCaptureContent(true);
proxyServer.setCaptureHeaders(true);
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.PROXY, proxy);
capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
FirefoxProfile fp = getFirefoxProfile();
fp.setAcceptUntrustedCertificates(true);
fp.setAssumeUntrustedCertificateIssuer(false);
capabilities.setCapability(AetFirefoxDriver.PROFILE, fp);
return new WebCommunicationWrapperImpl(getFirefoxDriver(fp, capabilities), proxyServer,
requestExecutorFactory
.createInstance());
} catch (Exception e) {
throw new WorkerException(e.getMessage(), e);
}
}
示例2: getFirefoxCapabilities
import org.openqa.selenium.firefox.FirefoxProfile; //导入方法依赖的package包/类
public Capabilities getFirefoxCapabilities() {
DesiredCapabilities firefox = DesiredCapabilities.firefox();
FirefoxProfile profile = new FirefoxProfile();
profile.setAcceptUntrustedCertificates(true);
profile.setAssumeUntrustedCertificateIssuer(true);
firefox.setCapability(FirefoxDriver.PROFILE, profile);
firefox.setCapability("marionette", true);
return firefox;
}
示例3: configProfile
import org.openqa.selenium.firefox.FirefoxProfile; //导入方法依赖的package包/类
protected void configProfile(final FirefoxProfile profile, final DriverConfig webDriverConfig) {
profile.setAcceptUntrustedCertificates(webDriverConfig.isSetAcceptUntrustedCertificates());
profile.setAssumeUntrustedCertificateIssuer(webDriverConfig.isSetAssumeUntrustedCertificateIssuer());
if (webDriverConfig.getFirefoxBinPath() != null) {
System.setProperty("webdriver.firefox.bin", webDriverConfig.getFirefoxBinPath());
}
if (webDriverConfig.getUserAgentOverride() != null) {
profile.setPreference("general.useragent.override", webDriverConfig.getUserAgentOverride());
}
if (webDriverConfig.getNtlmAuthTrustedUris() != null) {
profile.setPreference("network.automatic-ntlm-auth.trusted-uris", webDriverConfig.getNtlmAuthTrustedUris());
}
if (webDriverConfig.getBrowserDownloadDir() != null) {
profile.setPreference("browser.download.dir", webDriverConfig.getBrowserDownloadDir());
profile.setPreference("browser.download.folderList", 2);
profile.setPreference("browser.download.manager.showWhenStarting", false);
profile.setPreference("browser.helperApps.neverAsk.saveToDisk",
"application/octet-stream,text/plain,application/pdf,application/zip,text/csv,text/html");
}
if (!webDriverConfig.isEnableJavascript()) {
profile.setPreference("javascript.enabled", false);
}
// fix permission denied issues
profile.setPreference("capability.policy.default.Window.QueryInterface", "allAccess");
profile.setPreference("capability.policy.default.Window.frameElement.get", "allAccess");
profile.setPreference("capability.policy.default.HTMLDocument.compatMode.get", "allAccess");
profile.setPreference("capability.policy.default.Document.compatMode.get", "allAccess");
profile.setPreference("dom.max_chrome_script_run_time", 0);
profile.setPreference("dom.max_script_run_time", 0);
}
示例4: loadFirefoxProfile
import org.openqa.selenium.firefox.FirefoxProfile; //导入方法依赖的package包/类
/**
* Returns the basic firefox profile. Override this method to add custom
* profile.
*/
protected FirefoxProfile loadFirefoxProfile(WTFCountry country) {
FirefoxProfile profile = new FirefoxProfile();
profile.setEnableNativeEvents(true);
profile.setAssumeUntrustedCertificateIssuer(true);
if (country != null) {
System.out
.println("Setting firefox profile with intl.accept_langauges as '"
+ country.toString() + "'");
profile.setPreference("intl.accept_languages", country.toString()
.toLowerCase());
}
return profile;
}
示例5: initFirefoxDriver
import org.openqa.selenium.firefox.FirefoxProfile; //导入方法依赖的package包/类
/**
* initialization FirefoxDriver
*/
public static void initFirefoxDriver() {
ReporterNGExt.logTechnical("Initialization Firefox Driver");
FirefoxProfile profile = new FirefoxProfile();
profile.setAcceptUntrustedCertificates(true);
profile.setAssumeUntrustedCertificateIssuer(true);
profile.setEnableNativeEvents(true);
profile.setPreference("javascript.enabled", true);
profile.setPreference("dom.max_script_run_time", 0);
profile.setPreference("dom.max_chrome_script_run_time", 0);
setWebDriver(new FirefoxDriver(profile));
setTimeout(TIMEOUT);
getDriver().manage().window().maximize();
}
示例6: capabilitiesFirefox
import org.openqa.selenium.firefox.FirefoxProfile; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
private static DesiredCapabilities capabilitiesFirefox() {
final String geckoDriverPath = (applicationGeckoDriverPath == null)
? osName.toLowerCase().startsWith("windows")
? "c:/java/selenium/geckodriver.exe" : "/var/run/geckodriver"
: applicationGeckoDriverPath;
// firefox.browser.path
final String firefoxBrowserPath = (applicationFirefoxBrowserPath == null)
? osName.toLowerCase().startsWith("windows")
? "c:/Program Files (x86)/Mozilla Firefox/firefox.exe"
: osName.toLowerCase().startsWith("mac")
? "/Applications/Firefox.app/Contents/MacOS/firefox.bin"
: "/usr/bin/firefox/firefox"
: applicationFirefoxBrowserPath;
System.setProperty("webdriver.gecko.driver",
new File(geckoDriverPath).getAbsolutePath());
System.setProperty("webdriver.firefox.bin",
new File(firefoxBrowserPath).getAbsolutePath());
System.setProperty("webdriver.reap_profile", "false");
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
// TODO: switch to Selenium 3.X+
/*
FirefoxOptions firefoxOptions = new FirefoxOptions();
firefoxOptions.setBinary(new File(firefoxBrowserPath).getAbsolutePath());
capabilities.setCapability("moz:firefoxOptions", firefoxOptions);
*/
capabilities.setCapability("firefox_binary",
new File(firefoxBrowserPath).getAbsolutePath());
capabilities.setCapability("marionette", false);
FirefoxProfile profile = new FirefoxProfile();
// no longer exists in Selenium
// profile.setEnableNativeEvents(true);
profile.setAcceptUntrustedCertificates(true);
profile.setAssumeUntrustedCertificateIssuer(false);
// Disable Firefox Auto-Updating
profile.setPreference("app.update.auto", false);
profile.setPreference("app.update.enabled", false);
capabilities.setCapability(FirefoxDriver.PROFILE, profile);
capabilities.setCapability("elementScrollBehavior", 1);
capabilities.setBrowserName(DesiredCapabilities.firefox().getBrowserName());
return capabilities;
}