I have this:
System.setProperty(\"webdriver.gecko.driver\", \"gecko/linux/geckodriver\");
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference(\
you can pass capabilities into firefoxoptions constructor
as below :
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);
FirefoxOptions options = new FirefoxOptions(capabilities);
set profile to firefox options
options.setProfile(profile);
options.setLogLevel(Level.FINEST);
options.addPreference("browser.link.open_newwindow", 3);
options.addPreference("browser.link.open_newwindow.restriction", 0);
pass firefox options as parameter to create driver
WebDriver driver = new FirefoxDriver(options);