Java 类org.openqa.selenium.ie.InternetExplorerDriver 实例源码

项目:java-maven-selenium    文件:DriverFactory.java   
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();

        }
    }
项目:selenium-cucumber-framework    文件:BrowserFactory.java   
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");
    }
}
项目:SWET    文件:BrowserDriver.java   
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;
    }
项目:AutomationFrameworkTPG    文件:DriverProperties.java   
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);
}
项目:apache-archiva    文件:WebDriverBrowseTest.java   
@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();

}
项目:apache-archiva    文件:WebDriverTest.java   
@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();

}
项目:chr-krenn-fhj-ws2016-sd14-pse    文件:BaseUITest.java   
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();
    }
}
项目:g2    文件:WebDriverFactoryTest.java   
@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);
}
项目:learn_selenium2    文件:SeleniumDriver.java   
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;
}
项目:seleniumtestsframework    文件:IEDriverFactory.java   
@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;
}
项目:java-gradle-selenium    文件:DriverFactory.java   
@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();
    }
}
项目:SwiftLite    文件:WebDriverFactory.java   
@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);
}
项目:seauto    文件:AbstractConfigurableDriverProvider.java   
/**
 * Default implementation of getting a local Internet Explorer web driver.
 * 
 * @return the WebDriver
 */
protected WebDriver getInternetExplorerWebDriver()
{
  // Note: running ie9 32 bit driver is faster then 64 bit driver. Download
  // the preferred IEDriverServer.exe from selenium's website
  LOG.debug("Start IE");

  // Note: this driver is only used when running the tests locally in IE
  String ieDriverPath = getOsSpecificBinaryPathFromProp(IE_DRIVER_BIN_PROP, "IEDriverServer");

  if (StringUtils.isNotBlank(ieDriverPath) && doesFileExist(ieDriverPath)) {
    LOG.info("Use specified IE Driver path: {}", ieDriverPath);
    System.setProperty("webdriver.ie.driver", ieDriverPath);
  }
  else {
    LOG.debug("Use default IEDriverServer.exe location");
  }

  return new InternetExplorerDriver(getInternetExplorerCapabilities());
}
项目:seauto    文件:AbstractConfigurableDriverProvider.java   
/**
 * Best found default capabilities for Internet Explorer
 * 
 * @return {@link DesiredCapabilities}
 */
protected DesiredCapabilities getInternetExplorerCapabilities()
{
  final DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();

  // get past certificate security warning pages
  capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);

  // setup native events and window focus
  // http://jimevansmusic.blogspot.com/2012/06/whats-wrong-with-internet-explorer.html
  capabilities.setCapability(InternetExplorerDriver.NATIVE_EVENTS, true);
  capabilities.setCapability(InternetExplorerDriver.REQUIRE_WINDOW_FOCUS, true);

  // don't accept alerts automatically
  capabilities.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR, false);

  return capabilities;
}
项目:wtf-core    文件:WTFTest.java   
public synchronized WebDriver getDriver(WTFBrowser browser, WTFCountry country,
        ITestResult testResult) {
    switch (browser) {
    case FIREFOX:
        return new FirefoxDriver(loadFirefoxProfile(country));
    case IE:
        setIEDriverService();
        return new InternetExplorerDriver();
    case CHROME:
        setChromeDriverService();
        return new ChromeDriver();
    case OPERA:
        return new OperaDriver();
    default:
        // TOSO (vsundramurthy) Throw invalid browser exception..
        return null;
    }
}
项目:wisard    文件:BrowserDriver.java   
boolean initIE(String url, String path) {
    //IE
    try {
        System.setProperty("webdriver.ie.driver", path);
        driver = new InternetExplorerDriver();
        js = (JavascriptExecutor) driver;
        writer.writeHeader(url, "IE");
        driver.get(url);
    } catch (IllegalStateException ise) {
        ui.errorMessage("Path to IE driver is invalid, check settings.");
        return false;
    } catch (InvalidArgumentException iae) {
        ui.errorMessage("Invalid URL?");
        return false;
    } catch (Exception e) {
        System.err.println(e);
        return false;
    }
    return true;
}
项目:Swd.StarterJ    文件:WebDriverRunner.java   
private WebDriver startEmbededWebDriver(String browserType) {
    switch (browserType) {
        case BROWSER_FIREFOX:
            return new FirefoxDriver();
        case BROWSER_CHROME:
            return new ChromeDriver();
        case BROWSER_IE:
            return new InternetExplorerDriver();
         case BROWSER_SAFARI:
            return new SafariDriver();
        default:
            String errorMessage = String.format(
                    "browserType: <%s> was not recognized as supported browser."
                    + " This parameter is case sensitive", browserType);
            throw new IllegalArgumentException(errorMessage);
    }
}
项目:selenium-java-robot    文件:LocalRobotizedBrowserFactory.java   
public static LocalRobotizedBrowserFactory createRobotizedWebDriverFactory(String browser) {
    if (BrowserType.FIREFOX.equalsIgnoreCase(browser)) {
        FirefoxProfile firefoxProfile = null;
        String firefoxProfileProperty = System.getProperty("webdriver.firefox.profile");
        if (firefoxProfileProperty == null) {
            ProfilesIni allProfiles = new ProfilesIni();
            // Use the default profile to make extensions available,
            // and especially to ease debugging with Firebug
            firefoxProfile = allProfiles.getProfile("default");
        }
        return new LocalFirefox(firefoxProfile);
    } else if (BrowserType.SAFARI.equalsIgnoreCase(browser)) {
        return new LocalSafari();
    } else if (BrowserType.CHROME.equalsIgnoreCase(browser)) {
        return new LocalBrowser<ChromeDriver>(ChromeDriver.class);
    } else if ("chrome-debug".equalsIgnoreCase(browser)) {
        return new LocalDebuggableChrome();
    } else if (BrowserType.IE.equalsIgnoreCase(browser)) {
        return new LocalBrowser<InternetExplorerDriver>(InternetExplorerDriver.class);
    } else {
        throw new RuntimeException("Unknown browser value: " + browser);
    }

}
项目:web-test    文件:WebDriverUtilsTest.java   
@Test
public void saveScreenshotIETest() {
    if(System.getProperty("webdriver.ie.driver") == null) {
        throw new SkipException("The path to the driver executable (webdriver.ie.driver) is not set");
    }

    WebDriverFactory wdf = new WebDriverFactory("internet explorer");
    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
    WebDriver wd = wdf.createDriver(capabilities);
    wd.get("http://google.com");
    File screenshotFile = WebDriverUtils.saveScreenshot(wd, getScreenshotName("ie"));
    wd.quit();

    assertThat(screenshotFile.exists(), equalTo(true));

    if(Boolean.parseBoolean(System.getProperty("org.uncommons.reportng.escape-output", "true"))) {
        Reporter.log("Screenshot: " + screenshotFile.getAbsolutePath());
    } else {
        Reporter.log("<a href=\"file:///" + screenshotFile.getAbsolutePath() + "\">Screenshot</a>");
    }   
}
项目:gga-selenium-framework    文件:SeleniumDriverFactory.java   
private String registerLocalDriver(DriverTypes driverType) {
    DesiredCapabilities capabilities;
    switch (driverType) {
        case CHROME:
            setProperty("webdriver.chrome.driver", getDriversPath() + "chromedriver.exe");
            return registerDriver(driverType,
                    () -> webDriverSettings.apply(new ChromeDriver()));
        case FIREFOX:
            return registerDriver(driverType,
                    () -> webDriverSettings.apply(new FirefoxDriver()));
        case IE:
            capabilities = internetExplorer();
            capabilities.setCapability(INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
            setProperty("webdriver.ie.driver", getDriversPath() + "IEDriverServer.exe");
            return registerDriver(driverType,
                    () -> webDriverSettings.apply(new InternetExplorerDriver(capabilities)));
    }
    throw exception("Unknown driver: " + driverType);
}
项目:appengine    文件:WebDriverFactoryTest.java   
@Test
public void buildWebDriver() throws Exception {
    MockitoAnnotations.initMocks(this);

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

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

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

    PowerMockito.whenNew(HtmlUnitDriver.class).withArguments(true).thenReturn(htmlUnitDriver);
    driver = WebDriverFactory.createDriver("htmlunit");
    assertTrue(driver instanceof HtmlUnitDriver);

    PowerMockito.whenNew(RemoteWebDriver.class)
            .withArguments(new URL("http://localhost:4444/wd/hub"), DesiredCapabilities.firefox())
            .thenReturn(remoteWebDriver);
    driver = WebDriverFactory.createDriver("remote:localhost:4444:firefox");
    assertTrue(driver instanceof RemoteWebDriver);
}
项目:candybean    文件:InternetExplorerInterface.java   
@Override
public void start() throws CandybeanException {
    DesiredCapabilities capabilities = new DesiredCapabilities();
    String ieDriverPath = candybean.config.getPathValue("browser.ie.driver.path");
    if(StringUtils.isEmpty(ieDriverPath) || !new File(ieDriverPath).exists()){
        String error = "Unable to find internet explorer driver from the specified location("+ieDriverPath+") in the configuration file! \n"
                + "Please add a configuration to the candybean config file for key \"browser.ie.driver.path\" "
                + "that indicates the absolute location the driver.";
        logger.severe(error);
        throw new CandybeanException(error);
    }else{
        logger.info("ieDriverPath: " + ieDriverPath);
        System.setProperty("webdriver.ie.driver", ieDriverPath);
        capabilities = DesiredCapabilities.internetExplorer();
        super.wd = new InternetExplorerDriver(capabilities);
        super.start(); // requires wd to be instantiated first
    }
}
项目:at.info-knowledge-base    文件:upload_file.java   
static public void main(String[] args) {
    // Creating webdriver
    System.setProperty("webdriver.ie.driver", "C:\\WORK\\IEDriverServer_Win32_2.37.0\\IEDriverServer.exe");
    WebDriver driver = new InternetExplorerDriver();

// Opening page. In this case - local HTML file.
    driver.get("file://C:/WORK/test.html");

    // Find element that uploads file.
    WebElement fileInput = driver.findElement(By.id("file"));

    // Set direct path to local file that needs to be uploaded. 
    // That also can be a direct link to file in web, like - https://www.google.com.ua/images/srpr/logo11w.png
    fileInput.sendKeys("file://C:/WORK/lenna.png");

    // find button that sends form and click it.
    driver.findElement(By.id("submit")).click();

    // Closing driver and session
    driver.quit();
}
项目:galen    文件:SeleniumBrowserFactory.java   
public static WebDriver getDriver(String browserType){

    if ( StringUtils.isEmpty(browserType) || FIREFOX.equals(browserType)) {
        return new FirefoxDriver(SeleniumBrowserFactory.getBrowserCapabilities(browserType));
    }
    else if (CHROME.equals(browserType)) {
        return new ChromeDriver(SeleniumBrowserFactory.getBrowserCapabilities(browserType));
    }
    else if (IE.equals(browserType)) {
        return new InternetExplorerDriver(SeleniumBrowserFactory.getBrowserCapabilities(browserType));
    }
    else if (PHANTOMJS.equals(browserType)) {
        return new PhantomJSDriver();
    }
    else if (SAFARI.equals(browserType)) {
        return new SafariDriver();
    }
    else if (EDGE.equals(browserType)) {
        return new EdgeDriver();
    }
    else {
        throw new RuntimeException(String.format("Unknown browser type: \"%s\"", browserType));
    }
}
项目:SeleniumFramework    文件:Browser.java   
/**
 * This method initialises the ThreadLocal WebDriver object according to the
 * supplied parameters to enable tests to run on a users local machine.
 */
private void setLocalWebdriver() {

    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setJavascriptEnabled(true);
    capabilities.setCapability("handlesAlerts", true);
    switch (getBrowserId(browser)) {
        case 0:
            capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,
                    Boolean.valueOf(System.getProperty("IGNORE_SECURITY_DOMAINS", "false")));
            driver.set(new InternetExplorerDriver(capabilities));
            break;
        case 1:
            driver.set(new FirefoxDriver(capabilities));
            break;
        case 2:
            driver.set(new SafariDriver(capabilities));
            break;
        case 3:
            driver.set(new ChromeDriver(capabilities));
            break;
        default:
            throw new WebDriverException("Browser not found: " + browser);
    }
}
项目:SeleniumFramework    文件:BaseTest.java   
/**
 * This method initialises the ThreadLocal WebDriver object according to the
 * supplied parameters to enable tests to run on a users local machine.
 *
 * @param browser  This can be set to "chrome", "internet explorer" or "firefox"
 * @param version  This should be set to reflect the browser required. It is only
 *                 used when matching capabilities for a RemoteWebDriver object
 *                 however.
 * @param platform This should be set to whatever platform the test is required
 *                 to run on e.g. "WINDOWS", "MAC", "LINUX". It is only used when
 *                 matching capabilities for a RemoteWebDriver object however.
 */
public void setLocalWebdriver(String browser, String version,
                              String platform) {

    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setJavascriptEnabled(true);
    capabilities.setCapability("handlesAlerts", true);
    switch (getBrowserId(browser)) {
        case 0:
            capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,
                    Boolean.valueOf(System.getProperty("IGNORE_SECURITY_DOMAINS", "false")));
            driver.set(new InternetExplorerDriver(capabilities));
            break;
        case 1:
            driver.set(new FirefoxDriver(capabilities));
            break;
        case 2:
            driver.set(new SafariDriver(capabilities));
            break;
        case 3:
            driver.set(new ChromeDriver(capabilities));
            break;
        default:
            throw new WebDriverException("Browser not found: " + browser);
    }
}
项目:teasy    文件:SeleniumTestExecutionListener.java   
private WebDriver explorer(DesiredCapabilities customDesiredCapabilities) {
    InternetExplorerDriverManager.getInstance().version(STABLE_IE_DRIVER_VERSION).setup();
    DesiredCapabilities desiredCapabilities = getIEDesiredCapabilities();
    if (!customDesiredCapabilities.asMap().isEmpty()) {
        desiredCapabilities.merge(customDesiredCapabilities);
    }
    return new InternetExplorerDriver(desiredCapabilities);
}
项目:teasy    文件:SeleniumTestExecutionListener.java   
private WebDriver explorer(String version, DesiredCapabilities customDesiredCapabilities) {
    InternetExplorerDriverManager.getInstance().version(STABLE_IE_DRIVER_VERSION).setup();
    DesiredCapabilities desiredCapabilities = getIEDesiredCapabilities(version);
    if (!customDesiredCapabilities.asMap().isEmpty()) {
        desiredCapabilities.merge(customDesiredCapabilities);
    }
    return new InternetExplorerDriver(desiredCapabilities);
}
项目:teasy    文件:SeleniumTestExecutionListener.java   
private DesiredCapabilities getIEDesiredCapabilities() {
    DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
    capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
    capabilities.setCapability(InternetExplorerDriver.IE_SWITCHES, "-private");
    capabilities.setCapability(InternetExplorerDriver.FORCE_CREATE_PROCESS, true);
    capabilities.setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION, true);
    capabilities.setCapability(CapabilityType.SUPPORTS_ALERTS, true);
    capabilities.setPlatform(Platform.WINDOWS);
    capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
    setAlertBehaviorCapabilities(capabilities);
    setProxy(capabilities);
    //Found that setting this capability could increase IE tests speed. Should be checked.
    capabilities.setCapability(InternetExplorerDriver.REQUIRE_WINDOW_FOCUS, true);
    return capabilities;
}
项目:phoenix.webui.framework    文件:CapabilityConfig.java   
/**
 * 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);
}
项目:NoraUi    文件:DriverFactory.java   
/**
 * 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);
}
项目:Java-Testing-Toolbox    文件:InternetExplorerConfiguration.java   
/**
 * {@inheritDoc}
 */
@Override
public InternetExplorerDriver start(Capabilities other) {
    Capabilities capabilities = this.mergeCapabilities(other);

    if (capabilities == null) {
        return new InternetExplorerDriver();
    }

    return new InternetExplorerDriver(capabilities);
}
项目:Spring-Security-Third-Edition    文件:SeleniumTestUtilities.java   
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);
}
项目:Spring-Security-Third-Edition    文件:SeleniumTestUtilities.java   
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);
}
项目:Spring-Security-Third-Edition    文件:SeleniumTestUtilities.java   
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);
}
项目:Spring-Security-Third-Edition    文件:SeleniumTestUtilities.java   
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);
}
项目:Spring-Security-Third-Edition    文件:SeleniumTestUtilities.java   
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);
}
项目:Spring-Security-Third-Edition    文件:SeleniumTestUtilities.java   
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);
}
项目:Spring-Security-Third-Edition    文件:SeleniumTestUtilities.java   
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);
}
项目:Spring-Security-Third-Edition    文件:SeleniumTestUtilities.java   
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);
}