public SauceConfiguration createConfiguration(
     ArquillianDescriptor descriptor, Class<? extends Annotation> qualifier) {
   SauceConfiguration sauceConfiguration =
       new SauceConfiguration(SauceConfiguration.ConfigurationType.SELENIUM);
   SeleniumConfiguration seleniumConfiguration =
       new SeleniumConfiguration().configure(descriptor, qualifier);
   sauceConfiguration.setSeleniumConfiguration(seleniumConfiguration);
   return sauceConfiguration.configure(descriptor, qualifier);
 }
  /**
   * @param configuration
   * @return
   */
  public Selenium createInstance(SauceConfiguration configuration) {

    String username = readPropertyOrEnv("SAUCE_USER_NAME", configuration.getUserName());
    String apiKey = readPropertyOrEnv("SAUCE_API_KEY", configuration.getAccessKey());
    String host = readPropertyOrEnv("SELENIUM_HOST", configuration.getServerHost());
    String port = readPropertyOrEnv("SELENIUM_HOST", configuration.getServerHost());
    String browser = readPropertyOrEnv("SELENIUM_BROWSER", configuration.getBrowser());
    String version = readPropertyOrEnv("SELENIUM_VERSION", configuration.getVersion());
    String os = readPropertyOrEnv("SELENIUM_PLATFORM", configuration.getOs());
    String startingUrl = readPropertyOrEnv("SELENIUM_STARTING_URL", configuration.getUrl());
    DefaultSelenium selenium =
        new DefaultSelenium(
            host,
            Integer.valueOf(port),
            "{\"username\": \""
                + username
                + "\","
                + "\"access-key\": \""
                + apiKey
                + "\","
                + "\"os\": \""
                + os
                + "\","
                + "\"browser\": \""
                + browser
                + "\","
                + "\"browser-version\": \""
                + version
                + "\"}",
            startingUrl);
    return selenium;
  }