List of usage examples for org.openqa.selenium Platform extractFromSysProperty
public static Platform extractFromSysProperty(String osName, String osVersion)
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); } }