use of org.openqa.selenium.ie.InternetExplorerDriverService in project jmeter-plugins by undera.
the class InternetExplorerDriverConfigTest method shouldNotCreateInternetExplorerWhenStartingServiceThrowsAnException.
@Test
public void shouldNotCreateInternetExplorerWhenStartingServiceThrowsAnException() throws Exception {
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);
doThrow(new IOException("Stubbed exception")).when(mockService).start();
final InternetExplorerDriver browser = config.createBrowser();
assertThat(browser, is(nullValue()));
assertThat(config.getServices(), is(Collections.<String, InternetExplorerDriverService>emptyMap()));
verify(mockServiceBuilder, times(1)).build();
}
use of org.openqa.selenium.ie.InternetExplorerDriverService in project jmeter-plugins by undera.
the class InternetExplorerDriverConfigTest method shouldNotStopServiceIfNotRunningWhenQuitBrowserIsInvoked.
@Test
public void shouldNotStopServiceIfNotRunningWhenQuitBrowserIsInvoked() throws Exception {
InternetExplorerDriver mockInternetExplorerDriver = mock(InternetExplorerDriver.class);
InternetExplorerDriverService mockService = mock(InternetExplorerDriverService.class);
when(mockService.isRunning()).thenReturn(false);
config.getServices().put(config.currentThreadName(), mockService);
config.quitBrowser(mockInternetExplorerDriver);
verify(mockInternetExplorerDriver).quit();
assertThat(config.getServices(), is(Collections.<String, InternetExplorerDriverService>emptyMap()));
verify(mockService, times(0)).stop();
}
use of org.openqa.selenium.ie.InternetExplorerDriverService in project selenium_java by sergueik.
the class IEDriverFactory method newInstance.
@Override
public WebDriver newInstance(DriverOptions driverOptions) {
if (!OS.isFamilyWindows())
throw new UnsupportedOperationException("Unsupported platform: " + Platform.getCurrent());
InternetExplorerDriverService service = setupBuilder(new InternetExplorerDriverService.Builder(), driverOptions, IEDRIVER).build();
InternetExplorerOptions options = newInternetExplorerOptions(driverOptions);
options.merge(driverOptions.getCapabilities());
InternetExplorerDriver driver = new InternetExplorerDriver(service, options);
setInitialWindowSize(driver, driverOptions);
return driver;
}
Aggregations