Capabilities not passed to Firefox Webdriver in Selenium 4 in Java

53 views
Skip to first unread message

Joanna

unread,
Oct 2, 2023, 11:53:52 AM10/2/23
to Selenium Users
Hi everyone, 

I am trying to upgrade selenium from version 3 to version 4, but the Firefox webdriver capabilities seems to not be passed to the driver. 

The biggest issue is that pdfjs.disable option is not passed. 

The language is Java, I am using Selenium 4.12.0, firefox version is 116.

Firefox ffop = new FirefoxOptions();
ffop.addPreference("browser.helperApps.neverAsk.saveToDisk", "application/pdf");
ffop.addPreference("pdfjs.disabled", true);
ffop.addPreference("browser.download.panel.shown", false);
ffop.addPreference("useAutomationExtension", false);
ffop.addPreference( "plugins.always_open_pdf_externally", false);
ffop.addPreference("pdfjs.firstRun", false);
ffop.addPreference("plugin.disable_full_page_plugin_for_types", "application/pdf,application/vnd.adobe.xfdf,application/vnd.fdf,application/vnd.adobe.xdp+xml");
ffop.addPreference("plugin.scan.Acrobat", "99.0");
ffop.addPreference("plugin.scan.plid.all", false);

I am passing the options as this:

FirefoxOptions firefoxOptions = new FirefoxOptions();
static Map<String, Object> capabilities = new HashMap<>();
capabilities.put("moz:firefoxOptions", ffop);

firefoxOptions.setCapability("cloud:options",capabilities);
firefoxOptions.setCapability("selenoid:options", selenoidOptions);

remoteWebDriver = new RemoteWebDriver(url, firefoxOptions);

Thank you

Ricardo Alfredo Pavez Catrileo

unread,
Oct 7, 2023, 5:31:25 AM10/7/23
to Selenium Users
What I would do is check if the geckodriver driver starts locally first, you can validate it through postman with the JSON Wire Protocol function and if the driver communicates with the version of your browser you already have one less problem and the problem is not in the communication of these components...
Reply all
Reply to author
Forward
0 new messages