List of usage examples for org.openqa.selenium Platform is
public boolean is(Platform compareWith)
From source file:org.qe4j.web.OpenWebDriver.java
License:Open Source License
/** * Constructs the property key to lookup the browser binary path. * * @param platform//from w ww. j a va 2s. com * @param browser * @param version * @return property key to lookup browser binary else null if the binary is * not found or definition indicates it should use the default * binary */ protected String getBrowserBinaryPath(Platform platform, Browser browser, String version, Properties properties) { // determine platform part of property key String platformKeyPart = null; if (platform.is(Platform.LINUX)) { platformKeyPart = "linux"; } else if (platform.is(Platform.WINDOWS)) { platformKeyPart = "win"; } else if (platform.is(Platform.MAC)) { platformKeyPart = "mac"; } else { throw new IllegalArgumentException("platform " + platform + " not currently supported"); } String browserBinaryPropertyKey = "webdriver." + platformKeyPart + "." + browser.toString().toLowerCase() + "." + version; log.info("looking up webdriver browser binary path property {}", browserBinaryPropertyKey); String browserBinary = properties.getProperty(browserBinaryPropertyKey); if (browserBinary != null) { if (browserBinary.equals("")) { browserBinary = null; } else { log.info("using browser binary {}", browserBinary); } } return browserBinary; }