當前位置: 首頁>>代碼示例>>Java>>正文


Java DesiredCapabilities.internetExplorer方法代碼示例

本文整理匯總了Java中org.openqa.selenium.remote.DesiredCapabilities.internetExplorer方法的典型用法代碼示例。如果您正苦於以下問題:Java DesiredCapabilities.internetExplorer方法的具體用法?Java DesiredCapabilities.internetExplorer怎麽用?Java DesiredCapabilities.internetExplorer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.openqa.selenium.remote.DesiredCapabilities的用法示例。


在下文中一共展示了DesiredCapabilities.internetExplorer方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: capabilitiesInternetExplorer

import org.openqa.selenium.remote.DesiredCapabilities; //導入方法依賴的package包/類
private static DesiredCapabilities capabilitiesInternetExplorer() {

		DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
		final String ieDriverPath = (applicationIeDriverPath == null)
				? "c:/java/selenium/IEDriverServer.exe" : applicationIeDriverPath;
		System.setProperty("webdriver.ie.driver", ieDriverPath
		/* (new File(ieDriverPath)).getAbsolutePath() */);
		capabilities.setCapability(
				InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,
				true);
		capabilities.setCapability("ignoreZoomSetting", true);
		capabilities.setCapability("ignoreProtectedModeSettings", true);
		capabilities.setCapability("requireWindowFocus", true);
		capabilities.setBrowserName(
				DesiredCapabilities.internetExplorer().getBrowserName());
		return capabilities;
	}
 
開發者ID:sergueik,項目名稱:SWET,代碼行數:18,代碼來源:BrowserDriver.java

示例2: initIEDriver

import org.openqa.selenium.remote.DesiredCapabilities; //導入方法依賴的package包/類
private WebDriver initIEDriver(String appURL) {
	System.out.println("Launching IE browser..");
	DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer();
	ieCapabilities.setJavascriptEnabled(true); 
	ieCapabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS,   
			true); 
	ieCapabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,true); 
	ieCapabilities.setCapability(InternetExplorerDriver.IGNORE_ZOOM_SETTING,true);         
	ieCapabilities.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR,UnexpectedAlertBehaviour.DISMISS); //Accept unexpected alerts 
	ieCapabilities.setCapability("requireWindowFocus", true); 
	ieCapabilities.setCapability("enablePersistentHover", false); 
	ieCapabilities.setCapability(CapabilityType.ForSeleniumServer.ENSURING_CLEAN_SESSION, true);
	
	WebDriver driver=new InternetExplorerDriver(ieCapabilities);
	driver.manage().deleteAllCookies();
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
    for(String winHandle : driver.getWindowHandles()){
       driver =  driver.switchTo().window(winHandle);
    }
    driver.get(appURL);
	return new WebDriverProxy().protect(driver);
}
 
開發者ID:3pillarlabs,項目名稱:AutomationFrameworkTPG,代碼行數:23,代碼來源:DriverProperties.java

示例3: getEdgeDriver

import org.openqa.selenium.remote.DesiredCapabilities; //導入方法依賴的package包/類
public static WebDriver getEdgeDriver()
{
	String path = System.getProperty("user.dir") + "\\Drivers\\EdgeWebDriver.exe";
	System.setProperty("webdriver.ie.driver", path);
	DesiredCapabilities caps = DesiredCapabilities.internetExplorer();
	caps.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,	true);
	return new InternetExplorerDriver(caps);
}
 
開發者ID:PacktPublishing,項目名稱:Spring-Security-Third-Edition,代碼行數:9,代碼來源:SeleniumTestUtilities.java

示例4: get32IEDriver

import org.openqa.selenium.remote.DesiredCapabilities; //導入方法依賴的package包/類
public static WebDriver get32IEDriver()
{
	String path = System.getProperty("user.dir") + "\\Drivers\\IEDriverServer32.exe";
	System.setProperty("webdriver.ie.driver", path);
	DesiredCapabilities caps = DesiredCapabilities.internetExplorer();
	caps.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,	true);
	return new InternetExplorerDriver(caps);
}
 
開發者ID:PacktPublishing,項目名稱:Spring-Security-Third-Edition,代碼行數:9,代碼來源:SeleniumTestUtilities.java

示例5: get64IEDriver

import org.openqa.selenium.remote.DesiredCapabilities; //導入方法依賴的package包/類
public static WebDriver get64IEDriver()
{
	String path = System.getProperty("user.dir") + "\\Drivers\\IEDriverServer64.exe";
	System.setProperty("webdriver.ie.driver", path);
	DesiredCapabilities caps = DesiredCapabilities.internetExplorer();
	caps.setCapability(CapabilityType.BROWSER_NAME, "IE");
	caps.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,	true);

	return new InternetExplorerDriver(caps);
}
 
開發者ID:PacktPublishing,項目名稱:Spring-Security-Third-Edition,代碼行數:11,代碼來源:SeleniumTestUtilities.java

示例6: ie

import org.openqa.selenium.remote.DesiredCapabilities; //導入方法依賴的package包/類
/**
 * ie瀏覽器
 */
private void ie()
{
	String initialUrl = enginePro.getProperty(DriverConstants.INITIAL_URL,
			"http://surenpi.com");
	
	DesiredCapabilities capability = DesiredCapabilities.internetExplorer();
	capability.setCapability(
			InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
	capability.setCapability(InternetExplorerDriver.INITIAL_BROWSER_URL, initialUrl);
	capability.setCapability(InternetExplorerDriver.REQUIRE_WINDOW_FOCUS, false);
	engineCapMap.put(DRIVER_IE, capability);
}
 
開發者ID:LinuxSuRen,項目名稱:phoenix.webui.framework,代碼行數:16,代碼來源:CapabilityConfig.java

示例7: generateIEDriver

import org.openqa.selenium.remote.DesiredCapabilities; //導入方法依賴的package包/類
/**
 * Generates an ie webdriver. Unable to use it with a proxy. Causes a crash.
 *
 * @return
 *         An ie webdriver
 * @throws TechnicalException
 *             if an error occured when Webdriver setExecutable to true.
 */
private WebDriver generateIEDriver() throws TechnicalException {
    final String pathWebdriver = DriverFactory.getPath(Driver.IE);
    if (!new File(pathWebdriver).setExecutable(true)) {
        throw new TechnicalException(Messages.getMessage(TechnicalException.TECHNICAL_ERROR_MESSAGE_WEBDRIVER_SET_EXECUTABLE));
    }
    logger.info("Generating IE driver ({}) ...", pathWebdriver);

    System.setProperty(Driver.IE.getDriverName(), pathWebdriver);

    final DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
    capabilities.setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION, true);
    capabilities.setCapability(InternetExplorerDriver.IGNORE_ZOOM_SETTING, true);
    capabilities.setCapability(InternetExplorerDriver.REQUIRE_WINDOW_FOCUS, true);
    capabilities.setCapability(InternetExplorerDriver.NATIVE_EVENTS, false);
    capabilities.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR, UnexpectedAlertBehaviour.ACCEPT);
    capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
    capabilities.setCapability("disable-popup-blocking", true);
    capabilities.setJavascriptEnabled(true);

    setLoggingLevel(capabilities);

    // Proxy configuration
    if (Context.getProxy().getProxyType() != ProxyType.UNSPECIFIED && Context.getProxy().getProxyType() != ProxyType.AUTODETECT) {
        capabilities.setCapability(CapabilityType.PROXY, Context.getProxy());
    }

    return new InternetExplorerDriver(capabilities);
}
 
開發者ID:NoraUi,項目名稱:NoraUi,代碼行數:37,代碼來源:DriverFactory.java

示例8: ieDriver

import org.openqa.selenium.remote.DesiredCapabilities; //導入方法依賴的package包/類
protected void ieDriver() {
	DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
	capabilities.setCapability(InternetExplorerDriver.NATIVE_EVENTS, false);
	capabilities.setCapability(InternetExplorerDriver.ENABLE_PERSISTENT_HOVERING, false);
	capabilities.setCapability(InternetExplorerDriver.REQUIRE_WINDOW_FOCUS, false);
	capabilities.setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION, true);
	capabilities.setCapability(InternetExplorerDriver.IGNORE_ZOOM_SETTING, true);
	capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
	System.setProperty("webdriver.ie.driver","./src/main/resources/iedriver/IEDriverServer.exe");
	driver = new InternetExplorerDriver(capabilities);
	driver.manage().window().maximize();
}
 
開發者ID:AnujDasari,項目名稱:Actitime-Framework,代碼行數:13,代碼來源:DriverFactory.java


注:本文中的org.openqa.selenium.remote.DesiredCapabilities.internetExplorer方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。