Use EnvironmentUtils.getCurrentPlatformVersion() instead of getDriver().getCapabilities()