title: How to pass the capabilities and options into Firefoxdriver using Selenium through Java
body: <p>I have this:</p>
  
  <pre><code>System.setProperty("webdriver.gecko.driver", "gecko/linux/geckodriver");
  
  FirefoxProfile profile = new FirefoxProfile();
  profile.setPreference("network.proxy.no_proxies_on", "localhost");
  profile.setPreference("javascript.enabled", true);
  
  DesiredCapabilities capabilities = DesiredCapabilities.firefox();
  capabilities.setCapability("marionette", true);
  capabilities.setCapability(FirefoxDriver.PROFILE, profile);
  
  FirefoxOptions options = new FirefoxOptions();
  options.setLogLevel(Level.FINEST);
  options.addPreference("browser.link.open_newwindow", 3);
  options.addPreference("browser.link.open_newwindow.restriction", 0);
  </code></pre>
  
  <p>Now I have two different constructors:                  </p>
  
  <pre><code>WebDriver driver = new FirefoxDriver(capabilities);
  </code></pre>
  
  <p>and</p>
  
  <pre><code>WebDriver driver = new FirefoxDriver(options);
  </code></pre>
  
  <p>How can I pass them both (capabilities and options) into the <code>driver</code>? By the way, the IDE is telling me that <code>FirefoxDriver(capabilities)</code> is deprecated.</p>