Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛 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). #10278

Closed
MaheshkumarPalled opened this issue Jan 21, 2022 · 7 comments

Comments

@MaheshkumarPalled
Copy link

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

@github-actions
Copy link

@MaheshkumarPalled, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@MaheshkumarPalled MaheshkumarPalled changed the title [🐛 Bug]:Unable to install the extension(.xpi) using selenium 3.14.0 or 4.1.0 or 4.1.1 with FireFox version 91.4.1esr (64-bit). [🐛 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). Jan 21, 2022
@titusfortner
Copy link
Member

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:
mozilla/geckodriver#1476

@MaheshkumarPalled
Copy link
Author

Thank you. Will try this.
@titusfortner : Any sample to refer initiating WebDriver and extension using python script from Java class and reusing the webDriver in java class to run the test? I have my framework set-up in Java. So I was wondering as this is an issue since 2019. If there was a sample to refer. I tried to following.

  1. Created a .py file with the following code.
from selenium import webdriver

def installExtension(driverPath, extensionPath):
    driver = webdriver.Firefox(executable_path=driverPath)
    driver.install_addon(extensionPath,temporary=True)
    return driver
  1. Failed to retrieve the driver and use it in Java class.

Also tried to use Jython as it's not supporting Python 3.x version. Kind of stuck

@titusfortner
Copy link
Member

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

@MaheshkumarPalled
Copy link
Author

Thank you @titusfortner for the quick response. Above sample is really helpful and resolved my concern.

Thanks again..!

@MaheshkumarPalled
Copy link
Author

@titusfortner : Are you able to run FireFox extension tests on headless mode?

I end up seeing socket connection error. I was wondering if you achieved it. I looked at the test shared above, but I couldn't find headless test run after extension installation.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants