/** * This method is synchronized because multiple webdriver instances can be created in parallel. * However, they may use common system resources such as ports, so may potentially interfere * with each other. */ protected synchronized WebDriver newWebdriverInstance(final Class<? extends WebDriver> driverClass) { return newWebdriverInstance(driverClass, ""); }
/** * Create a new WebDriver instance of a given type. */ public WebDriver newInstanceOf(final SupportedWebDriver driverType) { if (driverType == null) { throw new IllegalArgumentException("Driver type cannot be null"); } return newWebdriverInstance(driverType.getWebdriverClass()); }
/** * Create a new WebDriver instance of a given type. */ public WebDriver newInstanceOf(final SupportedWebDriver driverType) { if (driverType == null) { throw new IllegalArgumentException("Driver type cannot be null"); } return newWebdriverInstance(driverType.getWebdriverClass()); }
/** * Create a new WebDriver instance of a given type. */ public WebDriver newInstanceOf(final SupportedWebDriver driverType) { if (driverType == null) { throw new IllegalArgumentException("Driver type cannot be null"); } return newWebdriverInstance(driverType.getWebdriverClass()); }
private WebDriver newDriverInstance() { try { webDriverFactory.setupFixtureServices(); return webDriverFactory.newWebdriverInstance(driverClass); } catch (UnsupportedDriverException e) { LOGGER.error("FAILED TO CREATE NEW WEBDRIVER_DRIVER INSTANCE " + driverClass + ": " + e.getMessage(), e); throw new UnsupportedDriverException("Could not instantiate " + driverClass, e); } }
private WebDriver newDriverInstance() { try { if (StepEventBus.getEventBus().isDryRun()) { return new WebDriverStub(); } else { webDriverFactory.setupFixtureServices(); return webDriverFactory.newWebdriverInstance(driverClass); } } catch (UnsupportedDriverException e) { LOGGER.error("FAILED TO CREATE NEW WEBDRIVER_DRIVER INSTANCE " + driverClass + ": " + e.getMessage(), e); throw new UnsupportedDriverException("Could not instantiate " + driverClass, e); } }
private WebDriver newDriverInstance() { try { if (StepEventBus.getEventBus().isDryRun()) { return new WebDriverStub(); } else { webDriverFactory.setupFixtureServices(); return webDriverFactory.newWebdriverInstance(driverClass, options, environmentVariables); } } catch (UnsupportedDriverException e) { throw new UnsupportedDriverException("Could not instantiate " + driverClass, e); } }
protected synchronized WebDriver newWebdriverInstance(final Class<? extends WebDriver> driverClass, String options, EnvironmentVariables environmentVariables) { RedimensionBrowser redimensionBrowser = new RedimensionBrowser(environmentVariables); try { SupportedWebDriver supportedDriverType = inEnvironment(environmentVariables).forDriverClass(driverClass); WebDriver driver = driverProviders().get(supportedDriverType).newInstance(options,environmentVariables); setImplicitTimeoutsIfSpecified(driver); redimensionBrowser.withDriver(driver); closeBrowser.closeWhenTheTestsAreFinished(driver); return driver; } catch (SerenityManagedException toPassThrough) { throw toPassThrough; } catch (Exception cause) { throw new UnsupportedDriverException("Could not instantiate new WebDriver instance of type " + driverClass + " (" + cause.getMessage(), cause); } }