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) 

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:org.openqa.grid.web.utils.BrowserNameUtils.java

License:Apache License

public static Map<String, Object> parseGrid2Environment(String environment) {
    Map<String, Object> ret = Maps.newHashMap();

    String[] details = environment.split(" ");
    if (details.length == 1) {
        // simple browser string
        ret.put(RegistrationRequest.BROWSER, details[0]);
    } else {/*from  w  w w  . j  a  v  a2s  . com*/
        // more complex. Only case handled so far = X on Y
        // where X is the browser string, Y the OS
        ret.put(RegistrationRequest.BROWSER, details[0]);
        if (details.length == 3) {
            ret.put(RegistrationRequest.PLATFORM, Platform.extractFromSysProperty(details[2]));
        }
    }

    return ret;
}