List of usage examples for org.openqa.selenium.ie InternetExplorerDriverService IE_DRIVER_EXE_PROPERTY
String IE_DRIVER_EXE_PROPERTY
To view the source code for org.openqa.selenium.ie InternetExplorerDriverService IE_DRIVER_EXE_PROPERTY.
Click Source Link
From source file:com.mgmtp.jfunk.samples.config.ConfigBrowser.java
License:Apache License
@Subscribe public void configureBrowser(final BeforeWebDriverCreationEvent event) { switch (browser) { case "firefox": { // configure Firefox }/*from w w w . ja va2s. c o m*/ case "chrome": { setPathToDriverIfExistsAndIsExecutable(relativePathToChromeDriver, ChromeDriverService.CHROME_DRIVER_EXE_PROPERTY); // configure Chrome break; } case "ie": { setPathToDriverIfExistsAndIsExecutable(relativePathToIeDriver, InternetExplorerDriverService.IE_DRIVER_EXE_PROPERTY); // configure InternetExplorer break; } default: { throw new RuntimeException(String.format("Please configure one of the supported browsers in %s", JFunkConstants.SCRIPT_PROPERTIES)); } } }
From source file:com.seleniumtests.ut.browserfactory.TestIECapabilityFactory.java
License:Apache License
@Test(groups = { "ut" })
public void testCreateIECapabilitiesStandardDriverPathLocal() {
try {//from w w w.ja va2 s.c o m
PowerMockito.mockStatic(Advapi32Util.class);
PowerMockito.when(Advapi32Util.registryGetValue(any(HKEY.class), anyString(), anyString()))
.thenReturn("1");
Mockito.when(config.getMode()).thenReturn(DriverMode.LOCAL);
new IECapabilitiesFactory(config).createCapabilities();
Assert.assertTrue(System.getProperty(InternetExplorerDriverService.IE_DRIVER_EXE_PROPERTY)
.replace(File.separator, "/").contains("/drivers/IEDriverServer_"));
} finally {
System.clearProperty(InternetExplorerDriverService.IE_DRIVER_EXE_PROPERTY);
}
}
From source file:com.seleniumtests.ut.browserfactory.TestIECapabilityFactory.java
License:Apache License
@Test(groups = { "ut" })
public void testCreateIECapabilitiesOverrideDriverPathLocal() {
try {//from w ww .j a v a 2 s. c o m
PowerMockito.mockStatic(Advapi32Util.class);
PowerMockito.when(Advapi32Util.registryGetValue(any(HKEY.class), anyString(), anyString()))
.thenReturn("1");
Mockito.when(config.getMode()).thenReturn(DriverMode.LOCAL);
Mockito.when(config.getIeDriverPath()).thenReturn("/opt/ie/driver/ie");
new IECapabilitiesFactory(config).createCapabilities();
Assert.assertEquals(System.getProperty(InternetExplorerDriverService.IE_DRIVER_EXE_PROPERTY)
.replace(File.separator, "/"), "/opt/ie/driver/ie");
} finally {
System.clearProperty(InternetExplorerDriverService.IE_DRIVER_EXE_PROPERTY);
}
}
From source file:com.seleniumtests.ut.browserfactory.TestIECapabilityFactory.java
License:Apache License
@Test(groups = { "ut" })
public void testCreateIECapabilitiesStandardDriverPathGrid() {
Mockito.when(config.getMode()).thenReturn(DriverMode.GRID);
new IECapabilitiesFactory(config).createCapabilities();
Assert.assertNull(System.getProperty(InternetExplorerDriverService.IE_DRIVER_EXE_PROPERTY));
}
From source file:org.glassfish.tyrus.tests.qa.SeleniumToolkit.java
License:Open Source License
public void setUpExplorer() { try {//from w ww . j a v a 2s . c om System.setProperty(InternetExplorerDriverService.IE_DRIVER_EXE_PROPERTY, getEnv("IE_DRIVER")); assert new File(System.getProperty(InternetExplorerDriverService.IE_DRIVER_EXE_PROPERTY)) .exists() : "IE_DRIVER exists"; driver = new InternetExplorerDriver(); commonBrowserSetup(); logger.log(Level.INFO, "IE Setup PASSED"); } catch (Exception ex) { logger.log(Level.SEVERE, "IE Setup FAILED: {0}", ex.getLocalizedMessage()); ex.printStackTrace(); } finally { assert driver != null : "Driver is null"; } }