question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[🐛 Bug]:Unable to install the extension(.xpi) using selenium-Java 3.14.0 or 4.1.0 or 4.1.1 with FireFox version 91.4.1esr (64-bit).

See original GitHub issue

What happened?

Steps to reproduce:

Trying to install the .xpi file using selenium supported code. FireFox browse is launched without Installation of extension.

Selenium Version : 3.14.0 or 4.1.0 or 4.1.1 Browser details : 91.4.1esr (64-bit)

Additional information :

  1. WebExtension is an internal company developed one.
  2. Extension is signed by Mozilla.
  3. Able to install the same .xpi manually but failed to it automated way.

Note: Also created a ticket to Mozilla team. https://bugzilla.mozilla.org/show_bug.cgi?id=1751301

How can we reproduce the issue?

Code sample.
==============

public void setUpDriver(WebDriver webDriver) {
FirefoxProfile firefoxProfile = new FirefoxProfile();
FirefoxOptions firefoxOptions = new firefoxOptions();
firefoxProfile.addExtension("extension.xpi");
firefoxOptions.setProfile(firefoxProfile);
webDriver = new FirefoxDriver(firefoxOptions);
}


### Relevant log output

```shell
1642794155603	geckodriver::marionette	DEBUG	Waiting 60s to connect to browser on 127.0.0.1:53260
1642794155604	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794155707	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794155810	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794155914	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794156018	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794156122	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794156227	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794156328	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794156429	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794156530	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794156632	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794156720	Marionette	INFO	Marionette enabled
1642794156733	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794156782	RemoteAgent	DEBUG	CDP enabled
1642794156801	Marionette	TRACE	Received observer notification toplevel-window-ready
1642794156834	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794156935	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794157037	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794157141	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794157245	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794157349	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794157449	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794157550	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794157652	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794157757	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794157858	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794157961	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794158066	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794158168	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794158271	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
2022-01-21 11:42:38.321 firefox-bin[15728:2463542] Warning: Expected min height of view: (<NSButton: 0x12e99bc00>) to be less than or equal to 30 but got a height of 32.000000. This error will be logged once per view in violation.
2022-01-21 11:42:38.322 firefox-bin[15728:2463542] Warning: Expected min height of view: (<NSButton: 0x12f816800>) to be less than or equal to 30 but got a height of 32.000000. This error will be logged once per view in violation.
2022-01-21 11:42:38.323 firefox-bin[15728:2463542] Warning: Expected min height of view: (<NSButton: 0x12f816c00>) to be less than or equal to 30 but got a height of 32.000000. This error will be logged once per view in violation.
2022-01-21 11:42:38.323 firefox-bin[15728:2463542] Warning: Expected min height of view: (<NSButton: 0x12f819400>) to be less than or equal to 30 but got a height of 32.000000. This error will be logged once per view in violation.
2022-01-21 11:42:38.324 firefox-bin[15728:2463542] Warning: Expected min height of view: (<NSButton: 0x12f813800>) to be less than or equal to 30 but got a height of 32.000000. This error will be logged once per view in violation.
2022-01-21 11:42:38.325 firefox-bin[15728:2463542] Warning: Expected min height of view: (<NSPopoverTouchBarItemButton: 0x12f819000>) to be less than or equal to 30 but got a height of 32.000000. This error will be logged once per view in violation.
2022-01-21 11:42:38.325 firefox-bin[15728:2463542] Warning: Expected min height of view: (<NSPopoverTouchBarItemButton: 0x12f8d7800>) to be less than or equal to 30 but got a height of 32.000000. This error will be logged once per view in violation.
1642794158378	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794158481	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794158581	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794158681	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794158782	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794158883	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
console.warn: SearchSettings: "get: No settings file exists, new profile?" (new NotFoundError("Could not open the file at /var/folders/j1/y271rqmn28bftgrb952g7n8m0000gs/T/rust_mozprofileeemMqK/search.json.mozlz4", (void 0)))
1642794158987	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794159091	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794159195	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794159299	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794159400	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794159504	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794159608	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794159708	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
console.error: BackgroundUpdate: 
  _reasonsToNotScheduleUpdates: Failed to check for Maintenance Service Registry Key: [Exception... "Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIUpdateProcessor.getServiceRegKeyExists]"  nsresult: "0x80004001 (NS_ERROR_NOT_IMPLEMENTED)"  location: "JS frame :: resource://gre/modules/BackgroundUpdate.jsm :: _reasonsToNotScheduleUpdates :: line 243"  data: no]
1642794159809	geckodriver::marionette	TRACE	Connection refused (os error 61). Retrying in 100ms
1642794159867	Marionette	TRACE	Received observer notification marionette-startup-requested
1642794159867	Marionette	TRACE	Waiting until startup recorder finished recording startup scripts...
1642794159881	Marionette	TRACE	All scripts recorded.
1642794159881	RemoteAgent	DEBUG	Setting recommended pref apz.content_response_timeout to 60000
1642794159882	RemoteAgent	DEBUG	Setting recommended pref browser.contentblocking.introCount to 99
1642794159882	RemoteAgent	DEBUG	Setting recommended pref browser.download.panel.shown to true
1642794159882	RemoteAgent	DEBUG	Setting recommended pref browser.pagethumbnails.capturing_disabled to true
1642794159882	RemoteAgent	DEBUG	Setting recommended pref browser.tabs.disableBackgroundZombification to false
1642794159882	RemoteAgent	DEBUG	Setting recommended pref browser.tabs.remote.separatePrivilegedContentProcess to false
1642794159882	RemoteAgent	DEBUG	Setting recommended pref browser.tabs.unloadOnLowMemory to false
1642794159882	RemoteAgent	DEBUG	Setting recommended pref browser.tabs.warnOnCloseOtherTabs to false
1642794159883	RemoteAgent	DEBUG	Setting recommended pref browser.toolbars.bookmarks.visibility to never
1642794159883	RemoteAgent	DEBUG	Setting recommended pref browser.urlbar.suggest.searches to false
1642794159884	RemoteAgent	DEBUG	Setting recommended pref datareporting.policy.dataSubmissionPolicyAccepted to false
1642794159884	RemoteAgent	DEBUG	Setting recommended pref dom.file.createInChild to true
1642794159884	RemoteAgent	DEBUG	Setting recommended pref dom.push.connection.enabled to false
1642794159884	RemoteAgent	DEBUG	Setting recommended pref extensions.getAddons.cache.enabled to false
1642794159884	RemoteAgent	DEBUG	Setting recommended pref extensions.getAddons.discovery.api_url to data:, 
1642794159884	RemoteAgent	DEBUG	Setting recommended pref network.http.prompt-temp-redirect to false
1642794159885	RemoteAgent	DEBUG	Setting recommended pref privacy.trackingprotection.enabled to false
1642794159885	RemoteAgent	DEBUG	Setting recommended pref security.notification_enable_delay to 0
1642794159885	RemoteAgent	DEBUG	Setting recommended pref signon.autofillForms to false
1642794159886	RemoteAgent	DEBUG	Setting recommended pref dom.disable_beforeunload to true
1642794159888	Marionette	INFO	Listening on port 53260
1642794159888	Marionette	DEBUG	Marionette is listening
1642794159922	Marionette	DEBUG	Accepted connection 0 from 127.0.0.1:53321
1642794159924	geckodriver::marionette	DEBUG	Connection to Marionette established on 127.0.0.1:53260.
1642794159930	Marionette	DEBUG	0 -> [0,1,"WebDriver:NewSession",{"acceptInsecureCerts":true,"browserName":"firefox"}]
1642794159932	RemoteAgent	WARN	TLS certificate errors will be ignored for this session
1642794159943	Marionette	DEBUG	0 <- [1,1,null,{"sessionId":"552ff1d9-46a1-6341-9127-a2af326a118e","capabilities":{"browserName":"firefox","browserVersion":"91.4. ... ofileeemMqK","moz:shutdownTimeout":60000,"moz:useNonSpecCompliantPointerOrigin":false,"moz:webdriverClick":true,"proxy":{}}}]
1642794159947	webdriver::server	DEBUG	<- 200 OK {"value":{"sessionId":"552ff1d9-46a1-6341-9127-a2af326a118e","capabilities":{"acceptInsecureCerts":true,"browserName":"firefox","browserVersion":"91.4.1","moz:accessibilityChecks":false,"moz:buildID":"20211215182543","moz:geckodriverVersion":"0.30.0","moz:headless":false,"moz:processID":15728,"moz:profile":"/var/folders/j1/y271rqmn28bftgrb952g7n8m0000gs/T/rust_mozprofileeemMqK","moz:shutdownTimeout":60000,"moz:useNonSpecCompliantPointerOrigin":false,"moz:webdriverClick":true,"pageLoadStrategy":"normal","platformName":"mac","platformVersion":"20.6.0","proxy":{},"setWindowRect":true,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unhandledPromptBehavior":"dismiss and notify"}}}
Jan 21, 2022 11:42:39 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C

Operating System

macOSBigSur, version 11.6.2 (20G314)

Selenium version

Java 3.14.0 or 4.1.0 or 4.1.1

What are the browser(s) and version(s) where you see this issue?

FireFox 91.4.1esr (64-bit)

What are the browser driver(s) and version(s) where you see this issue?

GeckDriver 0.30.0

Are you using Selenium Grid?

NA

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
titusfortnercommented, Jan 24, 2022

No, Selenium isn’t designed to pass driver instances between different languages. Not sure why I gave the Python example here, sorry. Check out this example in Java: https://github.com/SeleniumHQ/selenium/blob/trunk/java/test/org/openqa/selenium/firefox/FirefoxDriverTest.java#L531-L534

1reaction
titusfortnercommented, Jan 21, 2022

Yeah, the currently supported approach now is to add the extension from the install_addon() method on the firefox driver *after the session has been created. I filed an issue on geckodriver to allow it to be done during capability creation, but it is low priority: https://github.com/mozilla/geckodriver/issues/1476

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add extension(*.xpi file) to firefox driver in Java using ...
1 Answer 1 · 1. Creating new Firefox profile: 1.1. Hold down the Windows Key and Press R on your keyboard and write...
Read more >
Supported platforms — Firefox Source Docs documentation
Supported platforms¶. The following table shows a mapping between geckodriver releases, and required versions of Selenium and Firefox: geckodriver, Selenium ...
Read more >
Download Geckodriver: How to Install Using Firefox ... - Guru99
Selenium Webdriver version 2.53 is not compatible with Mozilla Firefox version 47.0+. The Firefox driver used in earlier versions of Mozilla ...
Read more >
Geckodriver Tutorial: Automation Testing on Firefox with ...
Learn to set up, download, and run scripts using Selenium FirefoxDriver or GeckoDriver for your Selenium test cases.
Read more >
Changelog - GitHub
Only supports Selenium 4 versions * Added default value for Server::get and ... Firefox: * Fixed a bug when web extension failed to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found