Example usage for org.openqa.selenium Platform extractFromSysProperty

List of usage examples for org.openqa.selenium Platform extractFromSysProperty

Introduction

In this page you can find the example usage for org.openqa.selenium Platform extractFromSysProperty.

Prototype

public static Platform extractFromSysProperty(String osName, String osVersion) 

Source Link

Document

Extracts platforms based on system properties in Java and uses a heuristic to determine the most likely operating system.

Usage

From source file:fr.jetoile.demo.breizhcamp.webapp.driver.WebDriverFactory.java

License:Apache License

private static WebDriver remoteDriver(DesiredCapabilities capabilities) throws UnsupportedDriverException {
    String osName = (String) capabilities.getCapability("os.name");

    capabilities.setPlatform(Platform.extractFromSysProperty(osName, ""));
    capabilities.setVersion((String) capabilities.getCapability("os.version"));

    String url = (String) capabilities.getCapability("webdriver.remote.url");
    try {/*from  w  w  w . java 2 s. co m*/
        return new RemoteWebDriver(new URL(url), capabilities);
    } catch (MalformedURLException e) {
        throw new UnsupportedDriverException("wrong parameters for remote webDriver: " + capabilities, e);
    }
}