private void throwUnsupportedDriverExceptionFor(final String driverType) { throw new UnsupportedDriverException(driverType + " is not a supported browser. Supported driver values are: " + SupportedWebDriver.listOfSupportedDrivers()); }
private void throwUnsupportedDriverExceptionFor(final String driverType) { throw new UnsupportedDriverException(driverType + " is not a supported browser. Supported driver values are: " + SupportedWebDriver.listOfSupportedDrivers()); }
private void throwUnsupportedDriverExceptionFor(final String driverType) { throw new UnsupportedDriverException(driverType + " is not a supported browser. Supported driver values are: " + SupportedWebDriver.listOfSupportedDrivers()); }
public static SupportedWebDriver getDriverTypeFor(final String value) throws UnsupportedDriverException { try { return SupportedWebDriver.valueOf(value.toUpperCase()); } catch (IllegalArgumentException e) { SupportedWebDriver closestMatchingDriver = getClosestDriverValueTo(value); throw new UnsupportedDriverException("Unsupported browser type: " + value + ". Did you mean " + closestMatchingDriver.toString().toLowerCase() + "?", e); } } }
public static SupportedWebDriver getDriverTypeFor(final String value) throws UnsupportedDriverException { try { return SupportedWebDriver.valueOrSynonymOf(value.toUpperCase()); } catch (IllegalArgumentException e) { SupportedWebDriver closestMatchingDriver = getClosestDriverValueTo(value); throw new UnsupportedDriverException("Unsupported browser type: " + value + ". Did you mean " + closestMatchingDriver.toString().toLowerCase() + "?", e); } }
public static SupportedWebDriver getDriverTypeFor(final String value) throws UnsupportedDriverException { try { return SupportedWebDriver.valueOf(value.toUpperCase()); } catch (IllegalArgumentException e) { SupportedWebDriver closestMatchingDriver = getClosestDriverValueTo(value); throw new UnsupportedDriverException("Unsupported browser type: " + value + ". Did you mean " + closestMatchingDriver.toString().toLowerCase() + "?", e); } }
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); } }
public WebDriver newAppiumDriver(URL hub, Capabilities capabilities, MobilePlatform platform) { switch (platform) { case ANDROID: AndroidDriver androidDriver = new AndroidDriver(hub, capabilities); driverProperties.registerCapabilities("appium", androidDriver.getCapabilities()); return androidDriver; case IOS: IOSDriver iosDriver = new IOSDriver(hub, capabilities); driverProperties.registerCapabilities("appium", iosDriver.getCapabilities()); return iosDriver; } throw new UnsupportedDriverException(platform.name()); }
return iosDriver; throw new UnsupportedDriverException(appiumTargetPlatform(testEnvironmentVariables).name());
private WebDriver newDriverUsingExternalServer(String options, EnvironmentVariables environmentVariables) { CapabilityEnhancer enhancer = new CapabilityEnhancer(environmentVariables, fixtureProviderService); if (StepEventBus.getEventBus().webdriverCallsAreSuspended()) { return new WebDriverStub(); } switch (appiumTargetPlatform(environmentVariables)) { case ANDROID: AndroidDriver androidDriver = new AndroidDriver(appiumUrl(environmentVariables), enhancer.enhanced(appiumCapabilities(options,environmentVariables), ANDROID) ); driverProperties.registerCapabilities("appium", capabilitiesToProperties(androidDriver.getCapabilities())); return androidDriver; case IOS: IOSDriver iosDriver = new IOSDriver(appiumUrl(environmentVariables), enhancer.enhanced(appiumCapabilities(options,environmentVariables), IPHONE)); driverProperties.registerCapabilities("appium", capabilitiesToProperties(iosDriver.getCapabilities())); return iosDriver; } throw new UnsupportedDriverException(appiumTargetPlatform(environmentVariables).name()); }
return driver; } catch (Exception cause) { throw new UnsupportedDriverException("Could not instantiate " + driverClass, cause);
return driver; } catch (Exception cause) { throw new UnsupportedDriverException("Could not instantiate " + driverClass, cause);