当前位置: 首页>>代码示例>>Java>>正文


Java InternetExplorerDriver类代码示例

本文整理汇总了Java中org.openqa.selenium.ie.InternetExplorerDriver的典型用法代码示例。如果您正苦于以下问题:Java InternetExplorerDriver类的具体用法?Java InternetExplorerDriver怎么用?Java InternetExplorerDriver使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


InternetExplorerDriver类属于org.openqa.selenium.ie包,在下文中一共展示了InternetExplorerDriver类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDriver

import org.openqa.selenium.ie.InternetExplorerDriver; //导入依赖的package包/类
public static WebDriver getDriver() {

        String browser = System.getenv("BROWSER");
        if (browser == null) {
            ChromeDriverManager.getInstance().setup();
            return new ChromeDriver();
        }
        switch (browser)
        {
            case "IE":
                InternetExplorerDriverManager.getInstance().setup();
                return new InternetExplorerDriver();
            case "FIREFOX":
                FirefoxDriverManager.getInstance().setup();
                return new FirefoxDriver();
            default:
                ChromeDriverManager.getInstance().setup();
                return new ChromeDriver();

        }
    }
 
开发者ID:getgauge-examples,项目名称:java-maven-selenium,代码行数:22,代码来源:DriverFactory.java

示例2: selectLocalBrowser

import org.openqa.selenium.ie.InternetExplorerDriver; //导入依赖的package包/类
public static WebDriver selectLocalBrowser() {
	switch (browser) {
	case Chrome:
		return new ChromeDriver();
	case Firefox:
		return new FirefoxDriver();
	case IE:
		return new InternetExplorerDriver();
	case Opera:
		return new OperaDriver();
	case Safari:
		return new SafariDriver();
	default:
		throw new WebDriverException("No browser specified");
	}
}
 
开发者ID:Spence1115,项目名称:selenium-cucumber-framework,代码行数:17,代码来源:BrowserFactory.java

示例3: create

import org.openqa.selenium.ie.InternetExplorerDriver; //导入依赖的package包/类
@Override
public WebDriver create() {
	DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer();		
	ieCapabilities.setCapability("unexpectedAlertBehaviour" , "ignore");
	//ieCapabilities.setCapability("enablePersistentHover", true);
	//TM:22/01/2014- Added following for GAIC
	ieCapabilities
	.setCapability(
			InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,
			true);// Add this desiredcapabilities when the security
					// level of IE not set to same.
	ieCapabilities.setBrowserName("SELENIUM");
	ieCapabilities.setJavascriptEnabled(true);
	ieCapabilities.setCapability("browserstack.ie.enablePopups", "true");
	ieCapabilities.setCapability("acceptSslCerts", "true");
	// ieCapabilities.setCapability("browserstack.ie.noFlash", "true");
	File file = new File(System.getProperty("user.dir") + "//exe//IEDriverServer.exe");
	System.setProperty("webdriver.ie.driver", file.getAbsolutePath());
	return new InternetExplorerDriver(ieCapabilities);
}
 
开发者ID:MastekLtd,项目名称:SwiftLite,代码行数:21,代码来源:WebDriverFactory.java

示例4: capabilitiesInternetExplorer

import org.openqa.selenium.ie.InternetExplorerDriver; //导入依赖的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

示例5: initIEDriver

import org.openqa.selenium.ie.InternetExplorerDriver; //导入依赖的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

示例6: getEdgeDriver

import org.openqa.selenium.ie.InternetExplorerDriver; //导入依赖的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

示例7: get32IEDriver

import org.openqa.selenium.ie.InternetExplorerDriver; //导入依赖的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

示例8: get64IEDriver

import org.openqa.selenium.ie.InternetExplorerDriver; //导入依赖的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

示例9: getDefaultDriver

import org.openqa.selenium.ie.InternetExplorerDriver; //导入依赖的package包/类
@Override
public WebDriver getDefaultDriver()
{
    String seleniumBrowser = System.getProperty( "selenium.browser" );

    if ( StringUtils.contains( seleniumBrowser, "chrome" ) )
    {
        return new ChromeDriver();
    }

    if ( StringUtils.contains( seleniumBrowser, "safari" ) )
    {
        return new SafariDriver();
    }

    if ( StringUtils.contains( seleniumBrowser, "iexplore" ) )
    {
        return new InternetExplorerDriver();
    }
    
    return new FirefoxDriver();

}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:24,代码来源:WebDriverBrowseTest.java

示例10: getDefaultDriver

import org.openqa.selenium.ie.InternetExplorerDriver; //导入依赖的package包/类
@Override
public WebDriver getDefaultDriver()
{
    String seleniumBrowser = System.getProperty( "selenium.browser" );

    if ( StringUtils.contains( seleniumBrowser, "chrome" ) )
    {
        return new ChromeDriver();
    }

    if ( StringUtils.contains( seleniumBrowser, "safari" ) )
    {
        return new SafariDriver();
    }

    if ( StringUtils.contains( seleniumBrowser, "iexplore" ) )
    {
        return new InternetExplorerDriver();
    }

    return new FirefoxDriver();

}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:24,代码来源:WebDriverTest.java

示例11: start

import org.openqa.selenium.ie.InternetExplorerDriver; //导入依赖的package包/类
WebDriver start(Capabilities capabilities) {
    switch (this) {
        case FIREFOX:
            return new FirefoxDriver(capabilities);
        case HTML_UNIT:
            return new HtmlUnitDriver(capabilities);
        case CHROME:
            return new ChromeDriver(capabilities);
        case EDGE:
            return new EdgeDriver(capabilities);
        case INTERNET_EXPLORER:
            return new InternetExplorerDriver(capabilities);
        case SAFARI:
            return new SafariDriver(capabilities);
        default:
            throw new AssertionError();
    }
}
 
开发者ID:chr-krenn,项目名称:chr-krenn-fhj-ws2016-sd14-pse,代码行数:19,代码来源:BaseUITest.java

示例12: buildWebDriver

import org.openqa.selenium.ie.InternetExplorerDriver; //导入依赖的package包/类
@Test
public void buildWebDriver() throws Exception {
	MockitoAnnotations.initMocks(this);

	PowerMockito.whenNew(FirefoxDriver.class).withNoArguments().thenReturn(firefoxDriver);
	WebDriver driver = WebDriverFactory.createDriver("firefox");
	assertThat(driver).isInstanceOf(FirefoxDriver.class);

	PowerMockito.whenNew(InternetExplorerDriver.class).withNoArguments().thenReturn(internetExplorerDriver);
	driver = WebDriverFactory.createDriver("ie");
	assertThat(driver).isInstanceOf(InternetExplorerDriver.class);

	PowerMockito.whenNew(ChromeDriver.class).withNoArguments().thenReturn(chromerDriver);
	driver = WebDriverFactory.createDriver("chrome");
	assertThat(driver).isInstanceOf(ChromeDriver.class);

	PowerMockito.whenNew(RemoteWebDriver.class)
			.withArguments(new URL("http://localhost:4444/wd/hub"), DesiredCapabilities.firefox())
			.thenReturn(remoteWebDriver);
	driver = WebDriverFactory.createDriver("remote:localhost:4444:firefox");
	assertThat(driver).isInstanceOf(RemoteWebDriver.class);
}
 
开发者ID:pengqiuyuan,项目名称:g2,代码行数:23,代码来源:WebDriverFactoryTest.java

示例13: initDriver

import org.openqa.selenium.ie.InternetExplorerDriver; //导入依赖的package包/类
private WebDriver initDriver() {
	if ("firefox".equals(Config.Browser)) {
		driver = new FirefoxDriver();
	} else if ("ie".equals(Config.Browser)) {
		System.setProperty("webdriver.ie.driver",
				"files/IEDriverServer.exe");
		driver = new InternetExplorerDriver();
	} else if ("chrome".equals(Config.Browser)) {
		System.setProperty("webdriver.chrome.driver",
				"files/chromedriver.exe");
		driver = new ChromeDriver();
		// Navigation navigation = driver.navigate();
		// navigation.to("https://www.baidu.com");
	} else {
		System.out.println("浏览器匹配值错误" + Config.Browser);
	}
	driver.manage().window().maximize();
	driver.manage().timeouts()
			.pageLoadTimeout(Config.waitTime, TimeUnit.SECONDS);
	return driver;
}
 
开发者ID:yajing-zh,项目名称:learn_selenium2,代码行数:22,代码来源:SeleniumDriver.java

示例14: createWebDriver

import org.openqa.selenium.ie.InternetExplorerDriver; //导入依赖的package包/类
@Override
public WebDriver createWebDriver() throws IOException {

    // killProcess();
    if (!OSUtility.isWindows()) {
        throw new RuntimeException("With gods grace IE browser is only supported on windows, Imagine a "
                + "situation when you have to fix IE bugs on Unix and Mac as well");
    }

    DriverConfig cfg = this.getWebDriverConfig();

    driver = new InternetExplorerDriver(new IECapabilitiesFactory().createCapabilities(cfg));

    // Implicit Waits to handle dynamic element. The default value is 5 seconds.
    setImplicitWaitTimeout(cfg.getImplicitWaitTimeout());
    if (cfg.getPageLoadTimeout() >= 0) {
        driver.manage().timeouts().pageLoadTimeout(cfg.getPageLoadTimeout(), TimeUnit.SECONDS);
    }

    this.setWebDriver(driver);
    return driver;
}
 
开发者ID:tarun3kumar,项目名称:seleniumtestsframework,代码行数:23,代码来源:IEDriverFactory.java

示例15: Setup

import org.openqa.selenium.ie.InternetExplorerDriver; //导入依赖的package包/类
@BeforeSuite
public void Setup() {
    // Uses chrome driver by default
    String browser = System.getenv("BROWSER");
    if (browser == null) {
        browser = DEFAULT;
    }

    if (browser.toLowerCase().equals(FIREFOX)) {
        FirefoxDriverManager.getInstance().setup();
        driver = new FirefoxDriver();
    } else if (browser.toLowerCase().equals(IE)) {
        InternetExplorerDriverManager.getInstance().setup();
        driver = new InternetExplorerDriver();
    } else {
        ChromeDriverManager.getInstance().setup();
        driver = new ChromeDriver();
    }
}
 
开发者ID:getgauge-examples,项目名称:java-gradle-selenium,代码行数:20,代码来源:DriverFactory.java


注:本文中的org.openqa.selenium.ie.InternetExplorerDriver类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。