org.openqa.selenium.ie.InternetExplorerDriver Java Examples

The following examples show how to use org.openqa.selenium.ie.InternetExplorerDriver. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WebDriverFactoryTests.java    From vividus with Apache License 2.0 6 votes vote down vote up
@Test
void testGetRemoteWebDriverIEDriver() throws Exception
{
    mockCapabilities(remoteWebDriver);
    setRemoteDriverUrl();
    DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
    desiredCapabilities.setBrowserName(BrowserType.IEXPLORE);
    when(remoteWebDriverFactory.getRemoteWebDriver(any(URL.class), any(DesiredCapabilities.class)))
            .thenReturn(remoteWebDriver);
    Timeouts timeouts = mockTimeouts(remoteWebDriver);
    desiredCapabilities.setCapability(InternetExplorerDriver.NATIVE_EVENTS, false);
    assertEquals(remoteWebDriver,
            ((WrapsDriver) webDriverFactory.getRemoteWebDriver(desiredCapabilities)).getWrappedDriver());
    verify(timeoutConfigurer).configure(timeouts);
    assertLogger();
}
 
Example #2
Source File: InternetExplorerDriverHandler.java    From selenium-jupiter with Apache License 2.0 6 votes vote down vote up
@Override
public void resolve() {
    try {
        Optional<Object> testInstance = context.getTestInstance();
        Optional<Capabilities> capabilities = annotationsReader
                .getCapabilities(parameter, testInstance);
        InternetExplorerOptions internetExplorerOptions = (InternetExplorerOptions) getOptions(
                parameter, testInstance);
        if (capabilities.isPresent()) {
            internetExplorerOptions.merge(capabilities.get());
        }
        object = new InternetExplorerDriver(internetExplorerOptions);
    } catch (Exception e) {
        handleException(e);
    }
}
 
Example #3
Source File: IECaps.java    From teasy with MIT License 6 votes vote down vote up
private InternetExplorerOptions getIEOptions() {
    InternetExplorerOptions caps = new InternetExplorerOptions();
    caps.setCapability("version", this.version);
    caps.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
    caps.setCapability(InternetExplorerDriver.IE_SWITCHES, "-private");
    caps.setCapability(InternetExplorerDriver.FORCE_CREATE_PROCESS, true);
    caps.setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION, true);
    caps.setCapability(CapabilityType.SUPPORTS_ALERTS, true);
    caps.setCapability("platform", Platform.WINDOWS);
    caps.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
    caps.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR, this.alertBehaviour);

    //Found that setting this capability could increase IE tests speed. Should be checked.
    caps.setCapability(InternetExplorerDriver.REQUIRE_WINDOW_FOCUS, true);
    setLoggingPrefs(caps);
    return caps;
}
 
Example #4
Source File: IEDriverFactory.java    From seleniumtestsframework with Apache License 2.0 6 votes vote down vote up
@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;
}
 
Example #5
Source File: DriverFactory.java    From java-maven-selenium with MIT License 6 votes vote down vote up
static WebDriver getDriver() {

        String browser = System.getenv("BROWSER");
        if (browser == null) {
            WebDriverManager.chromedriver().setup();
            return new ChromeDriver();
        }
        switch (browser)
        {
            case "IE":
                WebDriverManager.iedriver().setup();
                return new InternetExplorerDriver();
            case "EDGE":
                WebDriverManager.edgedriver().setup();
                return new EdgeDriver();
            case "FIREFOX":
                WebDriverManager.firefoxdriver().setup();
                return new FirefoxDriver();
            default:
                WebDriverManager.chromedriver().setup();
                return new ChromeDriver();

        }
    }
 
Example #6
Source File: BrowserDriver.java    From SWET with MIT License 6 votes vote down vote up
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;
	}
 
Example #7
Source File: InternetExplorerDriverConfigTest.java    From jmeter-plugins-webdriver with Apache License 2.0 6 votes vote down vote up
@Test
public void shouldCreateInternetExplorerAndStartService() throws Exception {
    InternetExplorerDriver mockInternetExplorerDriver = mock(InternetExplorerDriver.class);
    whenNew(InternetExplorerDriver.class).withParameterTypes(InternetExplorerDriverService.class, Capabilities.class).withArguments(isA(InternetExplorerDriverService.class), isA(Capabilities.class)).thenReturn(mockInternetExplorerDriver);
    InternetExplorerDriverService.Builder mockServiceBuilder = mock(InternetExplorerDriverService.Builder.class);
    whenNew(InternetExplorerDriverService.Builder.class).withNoArguments().thenReturn(mockServiceBuilder);
    when(mockServiceBuilder.usingDriverExecutable(isA(File.class))).thenReturn(mockServiceBuilder);
    InternetExplorerDriverService mockService = mock(InternetExplorerDriverService.class);
    when(mockServiceBuilder.build()).thenReturn(mockService);

    final InternetExplorerDriver browser = config.createBrowser();

    assertThat(browser, is(mockInternetExplorerDriver));
    verifyNew(InternetExplorerDriver.class, times(1)).withArguments(isA(InternetExplorerDriverService.class), isA(Capabilities.class));
    verify(mockServiceBuilder, times(1)).build();
    assertThat(config.getServices().size(), is(1));
    assertThat(config.getServices().values(), hasItem(mockService));
}
 
Example #8
Source File: InternetExplorerInterface.java    From candybean with GNU Affero General Public License v3.0 6 votes vote down vote up
@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
	}
}
 
Example #9
Source File: HtmlFileInputTest.java    From htmlunit with Apache License 2.0 6 votes vote down vote up
private void contentType(final String extension) throws Exception {
    final Map<String, Class<? extends Servlet>> servlets = new HashMap<>();
    servlets.put("/upload1", Upload1Servlet.class);
    servlets.put("/upload2", ContentTypeUpload2Servlet.class);
    startWebServer("./", new String[0], servlets);

    final WebDriver driver = getWebDriver();
    driver.get(URL_FIRST + "upload1");

    final File tmpFile = File.createTempFile("htmlunit-test", "." + extension);
    try {
        String path = tmpFile.getAbsolutePath();
        if (driver instanceof InternetExplorerDriver || driver instanceof ChromeDriver) {
            path = path.substring(path.indexOf('/') + 1).replace('/', '\\');
        }
        driver.findElement(By.name("myInput")).sendKeys(path);
        driver.findElement(By.id("mySubmit")).click();
    }
    finally {
        assertTrue(tmpFile.delete());
    }

    final String pageSource = driver.getPageSource();
    assertTrue(pageSource, pageSource.contains(getExpectedAlerts()[0]));
    assertFalse(pageSource, pageSource.contains(getExpectedAlerts()[1]));
}
 
Example #10
Source File: upload_file.java    From at.info-knowledge-base with MIT License 6 votes vote down vote up
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();
}
 
Example #11
Source File: LocaleDropdown.java    From keycloak with Apache License 2.0 6 votes vote down vote up
public void selectByText(String text) {
    // open the menu
    if (driver instanceof IOSDriver) { // TODO: Fix this! It's a very, very, ... very nasty hack for Safari on iOS - see KEYCLOAK-7947
        ((IOSDriver) driver).executeScript("arguments[0].setAttribute('style', 'display: block')", dropDownMenu);
    }
    else if (driver instanceof AndroidDriver || driver instanceof InternetExplorerDriver) { // Android needs to tap (no cursor)
                                                                                            // and IE has some bug so needs to click as well (instead of moving cursor)
        currentLocaleLink.click();
    }
    else {
        Actions actions = new Actions(driver);
        log.info("Moving mouse cursor to the localization menu");
        actions.moveToElement(currentLocaleLink).perform();
    }

    // click desired locale
    clickLink(dropDownMenu.findElement(By.xpath("./li/a[text()='" + text + "']")));
}
 
Example #12
Source File: Browser.java    From coteafs-selenium with Apache License 2.0 6 votes vote down vote up
private static WebDriver setupIeDriver() throws MalformedURLException {
    LOG.i("Setting up Internet Explorer driver...");
    setupDriver(iedriver());
    final InternetExplorerOptions ieOptions = new InternetExplorerOptions();
    ieOptions.destructivelyEnsureCleanSession();
    ieOptions.setCapability("requireWindowFocus", true);
    ieOptions.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
    final InternetExplorerDriverService ieService = InternetExplorerDriverService.createDefaultService();
    if (!OS.isWindows()) {
        Assert.fail("IE is not supported.");
    }
    if (appSetting().isHeadlessMode()) {
        LOG.w("IE does not support headless mode. Hence, ignoring the same...");
    }
    return new InternetExplorerDriver(ieService, ieOptions);
}
 
Example #13
Source File: URLUtils.java    From keycloak with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
private static boolean urlCheck(ExpectedCondition condition, boolean secondTry) {
    WebDriver driver = getCurrentDriver();

    try {
        (new WebDriverWait(driver, 5, 100)).until(condition);
    }
    catch (TimeoutException e) {
        if (driver instanceof InternetExplorerDriver && !secondTry) {
            // IE WebDriver has sometimes invalid current URL
            log.info("IE workaround: checking URL failed at first attempt - refreshing the page and trying one more time...");
            driver.navigate().refresh();
            urlCheck(condition, true);
        }
        else {
            return false;
        }
    }
    return true;
}
 
Example #14
Source File: PatternFlyClosableAlert.java    From keycloak with Apache License 2.0 6 votes vote down vote up
public void close() {
    try {
        closeButton.click();
        WaitUtils.pause(500); // Sometimes, when a test is too fast,
                                    // one of the consecutive alerts is not displayed;
                                    // to prevent this we need to slow down a bit
    }
    catch (WebDriverException e) {
        if (driver instanceof InternetExplorerDriver) {
            log.warn("Failed to close the alert; test is probably too slow and alert has already closed itself");
        }
        else {
            throw e;
        }
    }
}
 
Example #15
Source File: Shadow.java    From shadow-automation-selenium with Apache License 2.0 6 votes vote down vote up
public Shadow(WebDriver driver) {
	
	if (driver instanceof ChromeDriver) {
		sessionId  = ((ChromeDriver)driver).getSessionId();
		chromeDriver = (ChromeDriver)driver;
	} else if (driver instanceof FirefoxDriver) {
		sessionId  = ((FirefoxDriver)driver).getSessionId();
		firfoxDriver = (FirefoxDriver)driver;
	} else if (driver instanceof InternetExplorerDriver) {
		sessionId  = ((InternetExplorerDriver)driver).getSessionId();
		ieDriver = (InternetExplorerDriver)driver;
	} else if (driver instanceof RemoteWebDriver) {
		sessionId  = ((RemoteWebDriver)driver).getSessionId();
		remoteWebDriver = (RemoteWebDriver)driver;
	} 
	this.driver = driver;
}
 
Example #16
Source File: WebDriverTypeTests.java    From vividus with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
private static DesiredCapabilities testGetIExploreWebDriver(WebDriverConfiguration configuration) throws Exception
{
    DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
    InternetExplorerOptions internetExplorerOptions = new InternetExplorerOptions();
    whenNew(InternetExplorerOptions.class).withArguments(desiredCapabilities).thenReturn(internetExplorerOptions);
    whenNew(InternetExplorerOptions.class).withNoArguments().thenReturn(internetExplorerOptions);
    InternetExplorerDriver expected = mock(InternetExplorerDriver.class);
    whenNew(InternetExplorerDriver.class)
            .withParameterTypes(InternetExplorerOptions.class)
            .withArguments(internetExplorerOptions)
            .thenReturn(expected);
    WebDriver actual = WebDriverType.IEXPLORE.getWebDriver(desiredCapabilities, configuration);
    assertEquals(expected, actual);
    Map<String, Object> options = (Map<String, Object>) desiredCapabilities.getCapability(IE_OPTIONS);
    assertTrue((boolean) options.get(InternetExplorerDriver.REQUIRE_WINDOW_FOCUS));
    return desiredCapabilities;
}
 
Example #17
Source File: InternetExplorerBrowserFactoryTest.java    From darcy-webdriver with GNU General Public License v3.0 5 votes vote down vote up
@Test
public void shouldBeInstanceOfUntargetedInternetExplorerDriver() {
    WebDriverBrowserFactory browserFactory = new InternetExplorerBrowserFactory();

    browser = (WebDriverBrowser) browserFactory.newBrowser();
    ForwardingTargetedWebDriver webDriver = (ForwardingTargetedWebDriver) browser.getWrappedDriver();
    CachingTargetLocator targetLocator = (CachingTargetLocator) webDriver.getTargetLocator();

    assertThat(targetLocator.getUntargetedDriver(), instanceOf(InternetExplorerDriver.class));
}
 
Example #18
Source File: HTMLLauncher.java    From selenium with Apache License 2.0 5 votes vote down vote up
private WebDriver createDriver(String browser) {
  String[] parts = browser.split(" ", 2);
  browser = parts[0];
  switch (browser) {
    case "*chrome":
    case "*firefox":
    case "*firefoxproxy":
    case "*firefoxchrome":
    case "*pifirefox":
      FirefoxOptions options = new FirefoxOptions().setLegacy(false);
      if (parts.length > 1) {
        options.setBinary(parts[1]);
      }
      return new FirefoxDriver(options);

    case "*iehta":
    case "*iexplore":
    case "*iexploreproxy":
    case "*piiexplore":
      return new InternetExplorerDriver();

    case "*googlechrome":
      return new ChromeDriver();

    case "*MicrosoftEdge":
      return new EdgeDriver();

    case "*opera":
    case "*operablink":
      return new OperaDriver();

    case "*safari":
    case "*safariproxy":
      return new SafariDriver();

    default:
      throw new RuntimeException("Unrecognized browser: " + browser);
  }
}
 
Example #19
Source File: SeleniumTestUtilities.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
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);
}
 
Example #20
Source File: ElementService.java    From senbot with MIT License 5 votes vote down vote up
/**
 * Clicks a button. Always use this method if you plan to run the tests on
 * IE9 In IE9 element.click() does not in a reliable way on buttons.
 * 
 * @param button
 *            The element to click at
 * @deprecated I'm sure there are better ways to click a button. Legacy code
 *             we need to remove at some stage.
 */
public void ieSaveButtonClick(WebElement button) {
	WebDriver driver = getWebDriver();
	// This shall solve the clicking problems IE9 has
	if (driver instanceof InternetExplorerDriver) {
		((JavascriptExecutor) driver).executeScript("arguments[0].click()", button);
	} else {
		button.click();
	}
}
 
Example #21
Source File: InternetExplorerLocalProxy.java    From at.info-knowledge-base with MIT License 5 votes vote down vote up
@BeforeMethod
public void setUpProxy() throws Exception {
    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability(CapabilityType.PROXY, getProxy());
    //or
    //capabilities.setCapability(CapabilityType.PROXY, server.seleniumProxy());
    driver = new InternetExplorerDriver(capabilities);
}
 
Example #22
Source File: DefaultLocalDriverProviderTest.java    From webdriver-factory with Apache License 2.0 5 votes vote down vote up
@Test
@EnabledOnOs(OS.WINDOWS)
@DisabledIfEnvironmentVariable(named = "CI", matches = "true")
void canInstantiateInternetExplorerDriverWithInternetExplorerOptions() {
  driver = provider.createDriver(new InternetExplorerOptions());
  assertTrue(driver instanceof InternetExplorerDriver);
}
 
Example #23
Source File: WisdomFluentLeniumTest.java    From wisdom with Apache License 2.0 5 votes vote down vote up
@Override
public WebDriver getDefaultDriver() {
    String browser = System.getProperty("fluentlenium.browser");
    LOGGER.debug("Selecting Selenium Browser using " + browser);
    if (browser == null) {
        LOGGER.debug("Using default HTML Unit Driver");
        return new HtmlUnitDriver();
    }

    if ("chrome".equalsIgnoreCase(browser)) {
        LOGGER.debug("Using Chrome");
        return new ChromeDriver();
    }

    if ("firefox".equalsIgnoreCase(browser)) {
        LOGGER.debug("Using Firefox");
        return new FirefoxDriver();
    }

    if ("ie".equalsIgnoreCase(browser) || "internetexplorer".equalsIgnoreCase(browser)) {
        LOGGER.debug("Using Internet Explorer");
        return new InternetExplorerDriver();
    }

    if ("safari".equalsIgnoreCase(browser)) {
        LOGGER.debug("Using Safari");
        return new SafariDriver();
    }

    throw new IllegalArgumentException("Unknown browser : " + browser);
}
 
Example #24
Source File: IExploreBrowser.java    From SeleniumCucumber with GNU General Public License v3.0 5 votes vote down vote up
public Capabilities getIExplorerCapabilities() {
	DesiredCapabilities cap = DesiredCapabilities.internetExplorer();
	cap.setCapability(InternetExplorerDriver.ELEMENT_SCROLL_BEHAVIOR,
			ElementScrollBehavior.BOTTOM);
	cap.setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION, true);
	cap.setCapability(
			InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,
			true);
	cap.setCapability(InternetExplorerDriver.IGNORE_ZOOM_SETTING, true);
	cap.setJavascriptEnabled(true);
	return cap;
}
 
Example #25
Source File: TestBaseCase.java    From PatatiumWebUi with Apache License 2.0 5 votes vote down vote up
/**
 * 用枚举类型列出浏览器列表,用于设置浏览器类型的函数参数
 * @author zheng
 *
 */
private WebDriver setDriver(String browsername)
{
	switch (browsername)
	{

		case "FirefoxDriver" :
			System.setProperty("webdriver.firefox.bin", "C:/Program Files (x86)/Mozilla Firefox/firefox.exe");
			FirefoxProfile firefoxProfile=new FirefoxProfile();
			//设置默认下载路径
			firefoxProfile.setPreference("browser.download.folderList", 2);
			firefoxProfile.setPreference("browser.download.dir", "D:\\自动化测试下载文件");
			//加载firebug插件
			firefoxProfile.setPreference("extensions.firebug.currentVersion", "2.0.13");
			firefoxProfile.setPreference("extensions.firebug.allPagesActivation", "none");
			//加载firepath插件
			firefoxProfile.setPreference("extensions.firepath.currentVersion", "0.9.7.1.1");
			firefoxProfile.setPreference("extensions.firepath.allPagesActivation", "on");
			this.driver=new FirefoxDriver(firefoxProfile);
			break;
		case "ChormeDriver":
			System.setProperty("webdriver.chrome.driver", "resource\\chromedriver.exe");
			this.driver=new ChromeDriver();
			break;
		case "InternetExplorerDriver":
			System.setProperty("webdriver.ie.driver", "resource\\IEDriverServer_Win32_2.48.0\\IEDriverServer.exe");
			DesiredCapabilities dc = DesiredCapabilities.internetExplorer();
			dc.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
			dc.setCapability("ignoreProtectedModeSettings", true);
			this.driver=new InternetExplorerDriver(dc);
			break;
		case "HtmlUnitDriver":
			this.driver=new HtmlUnitDriver();
			break;
		default:
			this.driver=new FirefoxDriver();
			break;
	}
	return driver;
}
 
Example #26
Source File: SeleniumTestUtilities.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
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);
}
 
Example #27
Source File: SeleniumTestUtilities.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
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);
}
 
Example #28
Source File: SeleniumTestUtilities.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
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);
}
 
Example #29
Source File: SeleniumTestUtilities.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
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);
}
 
Example #30
Source File: IECapabilities.java    From carina with Apache License 2.0 5 votes vote down vote up
public DesiredCapabilities getCapability(String testName) {
    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities = initBaseCapabilities(capabilities, BrowserType.IE, testName);
    capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
    capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
    capabilities.setCapability(CapabilityType.TAKES_SCREENSHOT, false);
    
    //update browser language
    String browserLang = Configuration.get(Parameter.BROWSER_LANGUAGE); 
    if (!browserLang.isEmpty()) {
    	Assert.fail("Unable to change IE locale via selenium! (" + browserLang + ")");
    }
    return capabilities;
}