Search in sources :

Example 1 with DeploymentEndpoints

use of com.liveperson.ephemerals.deploy.DeploymentEndpoints in project ephemerals by LivePersonInc.

the class AppiumAndroidEphemeral method createObject.

@Override
protected AndroidDriver createObject(DeploymentEndpoints endpoints) {
    URL remoteWebDriverUrl = null;
    for (DeploymentEndpoints.Endpoint endpoint : endpoints.list()) {
        if (endpoint.getName().equals("appium-server")) {
            String host = endpoint.getHost();
            int port = endpoint.getPort();
            try {
                remoteWebDriverUrl = new URL(String.format("http://%s:%s/%s", host, port, "/wd/hub"));
                logger.info("RemoteWebDriver URL {}", remoteWebDriverUrl);
            } catch (MalformedURLException e) {
                return null;
            }
        }
    }
    return new AndroidDriver(remoteWebDriverUrl, desiredCapabilities);
}
Also used : MalformedURLException(java.net.MalformedURLException) DeploymentEndpoints(com.liveperson.ephemerals.deploy.DeploymentEndpoints) AndroidDriver(io.appium.java_client.android.AndroidDriver) URL(java.net.URL)

Aggregations

DeploymentEndpoints (com.liveperson.ephemerals.deploy.DeploymentEndpoints)1 AndroidDriver (io.appium.java_client.android.AndroidDriver)1 MalformedURLException (java.net.MalformedURLException)1 URL (java.net.URL)1