public DriverSource getDriverSource() { String providedDriverType = getDriverName(); Preconditions.checkNotNull(providedDriverType, "No provider type was specified in 'webdriver.provided.type'"); String providedImplementation = environmentVariables.getProperty("webdriver.provided." + providedDriverType); Preconditions.checkNotNull(providedImplementation, "No provider implementation was specified in 'webdriver.provided.'" + providedDriverType); try { return (DriverSource) Class.forName(providedImplementation).newInstance(); } catch (Exception e) { throw new RuntimeException("Could not instantiate the custom webdriver provider of type " + providedImplementation); } }
public DriverSource getDriverSource() { String providedDriverType = getDriverName(); Preconditions.checkNotNull(providedDriverType, "No provider type was specified in 'webdriver.provided.type'"); String providedImplementation = environmentVariables.getProperty("webdriver.provided." + providedDriverType); Preconditions.checkNotNull(providedImplementation, "No provider implementation was specified in 'webdriver.provided.'" + providedDriverType); try { return (DriverSource) Class.forName(providedImplementation).newInstance(); } catch (Exception e) { throw new RuntimeException("Could not instantiate the custom webdriver provider of type " + providedImplementation); } }
public DriverSource getDriverSource() { String providedDriverType = getDriverName(); Preconditions.checkNotNull(providedDriverType, "No provider type was specified in 'webdriver.provided.type'"); String providedImplementation = environmentVariables.getProperty("webdriver.provided." + providedDriverType); Preconditions.checkNotNull(providedImplementation, "No provider implementation was specified in 'webdriver.provided.'" + providedDriverType); try { return (DriverSource) Class.forName(providedImplementation).newInstance(); } catch (Exception e) { throw new RuntimeException("Could not instantiate the custom webdriver provider of type " + providedImplementation); } }
private WebDriver providedDriver() { ProvidedDriverConfiguration sourceConfig = new ProvidedDriverConfiguration(environmentVariables); try { return sourceConfig.getDriverSource().newDriver(); } catch (Exception e) { throw new RuntimeException("Could not instantiate the custom webdriver provider of type " + sourceConfig.getDriverName()); } }
private WebDriver providedDriver() { ProvidedDriverConfiguration sourceConfig = new ProvidedDriverConfiguration(environmentVariables); try { return sourceConfig.getDriverSource().newDriver(); } catch (Exception e) { throw new RuntimeException("Could not instantiate the custom webdriver provider of type " + sourceConfig.getDriverName()); } }
@Override public WebDriver newInstance(String options, EnvironmentVariables environmentVariables) { if (StepEventBus.getEventBus().webdriverCallsAreSuspended()) { return new WebDriverStub(); } ProvidedDriverConfiguration sourceConfig = new ProvidedDriverConfiguration(environmentVariables); try { return sourceConfig.getDriverSource().newDriver(); } catch (Exception e) { throw new RuntimeException("Could not instantiate the custom webdriver provider of type " + sourceConfig.getDriverName(), e); } } }