Example usage for org.openqa.selenium.remote UnreachableBrowserException getMessage

List of usage examples for org.openqa.selenium.remote UnreachableBrowserException getMessage

Introduction

In this page you can find the example usage for org.openqa.selenium.remote UnreachableBrowserException getMessage.

Prototype

@Override
    public String getMessage() 

Source Link

Usage

From source file:at.tugraz.ist.cucumber.SeleniumStepdefs.java

License:Open Source License

private void initDriver(DesiredCapabilities capabilities) {
    if (this.isDriverReady) {
        return;//  ww w  .  j av  a 2  s. c  om
    }

    try {
        driver = new RemoteWebDriver(new URL("http://" + this.hubHost + ":" + this.hubPort + "/wd/hub"),
                capabilities);
    } catch (UnreachableBrowserException e) {
        Assert.fail("UnreachableBrowserException: " + e.getMessage());
    } catch (MalformedURLException e) {
        Assert.fail("MalformedURLException: http://" + this.hubHost + ":" + this.hubPort + "/wd/hub");
    } catch (WebDriverException e) {
        Assert.fail("WebDriverException: " + e.getMessage());
    }
    this.isDriverReady = true;
}

From source file:com.comcast.magicwand.spells.saucelabs.SauceProvider.java

License:Apache License

/**
 * Creates an instance of a {@link PhoenixDriver} that is representing {@link SaucePhoenixDriver}
 * @return Instance of a {@link SaucePhoenixDriver}
 * @throws FlyingPhoenixException If there was an error creating a driver
 *///w w w  . j a  v a  2  s .  c  o  m
public PhoenixDriver buildDriver() throws FlyingPhoenixException {
    if (null == this.username) {
        throw new FlyingPhoenixException("Errors while validating builder parameters",
                new SauceException("Username must be provided"));
    }

    if (null == this.apiKey) {
        throw new FlyingPhoenixException("Errors while validating builder parameters",
                new SauceException("API Key must be provided"));
    }

    this.customCapabilities.setCapability("platform", this.desktopOS.toString());

    if (null == this.cookieHandler) {
        this.cookieHandler = new GeneralCookieHandler();
    }

    URL remoteAddress = generateSauceURL();

    try {
        SauceTunnelManager vpnManager = initSauceConnect();

        WebDriver driver = createWebDriver(remoteAddress);
        SaucePhoenixDriver spd = new SaucePhoenixDriver(driver, cookieHandler, vpnManager,
                this.driverCustomConfig);
        LOG.debug("Driver is: " + spd);
        return spd;
    } catch (UnreachableBrowserException e) {
        LOG.error("Unreachable Browser Exception was caught. " + e.getMessage());
        throw new FlyingPhoenixException("Errors while validating builder parameters",
                new SauceException("There was an error creating a sauce driver", e));
    }
}

From source file:org.kurento.test.base.KurentoTest.java

License:Open Source License

@After
public void teardownKurentoTest() {
    if (testScenario != null) {
        for (BrowserClient browserClient : testScenario.getBrowserMap().values()) {
            try {
                browserClient.close();//from  w  w w  .  j  a v  a  2 s .  c o m
            } catch (UnreachableBrowserException e) {
                log.warn(e.getMessage());
            }
        }
    }
}