private static FirefoxOptions setCommonFirefoxOptions(Capability capability, BrowserSpecs specs) {
    FirefoxProfile firefoxProfile = null;
    String profile = System.getProperty("kite.firefox.profile")  ;
    profile = profile == null ? specs.getProfile() : profile;
    if (profile != null && !profile.isEmpty()) {
      switch (specs.getPlatform().name().toUpperCase()) {
        case "WINDOWS":
          profile += "windows";
          break;
        case "MAC":
          profile += "mac";
          break;
        case "LINUX":
          profile += "linux";
          break;
      }
      firefoxProfile = new FirefoxProfile(new File(profile));
    } else {
      logger.warn("FIREFOX: Some tests require specific profile for firefox to work properly.");
      firefoxProfile = new FirefoxProfile();
    }
    firefoxProfile.setPreference("media.navigator.permission.disabled", true);
    firefoxProfile.setPreference("media.autoplay.enabled.user-gestures-needed", false);
    if (capability.useFakeMedia()) {
      if (capability.getAudio() == null && capability.getVideo() == null) {
        firefoxProfile.setPreference("media.navigator.streams.fake", capability.useFakeMedia());
      }
    }
    FirefoxOptions firefoxOptions = new FirefoxOptions();
    firefoxOptions.setProfile(firefoxProfile);
    if (capability.isHeadless()) {
      firefoxOptions.addArguments("-headless");
    }
    if (capability.getWindowSize() != null) {
      firefoxOptions.addArguments("-window-size " + capability.getWindowSize());
    }
    for (String flag : capability.getFlags()) {
      firefoxOptions.addArguments(flag);
    }
    return firefoxOptions;
  }
Create common firefox option to create firefox web driver

@param capability the Client capability
@param specs the Client browser specs
@return the firefox option
KITE-Framework/src/main/java/org/webrtc/kite/WebDriverFactory.java