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]: Lates Firefox browser version(v 102) is not support with selenium. #10840

Closed
TJay90 opened this issue Jul 4, 2022 · 18 comments
Closed
Labels
I-issue-template Applied to issues not following the template, or missing information. R-awaiting answer

Comments

@TJay90
Copy link

TJay90 commented Jul 4, 2022

What happened?

When I try to run my selenium Test cases with the lates Firefox browser version (102), getting NS_Binding_Aborted (SessionNotCreated) Error.

When I trigger the test Browser opens and closed and getting the above error.

But when I run the test on downgraded Firefox browser (v101), tests are running successfully. So Im assuming Latest Firefox browser is not support with Selenium.

How can we reproduce the issue?

I'm unable to share any repo files since this is my office work related. Only way that you could reproduce, try to run a selenium C# with the lates gecko driver and the lates Firefox browser.

Relevant log output

System.InvalidOperationException: Error: NS_BINDING_ABORTED (SessionNotCreated)

Operating System

macOS

Selenium version

.Net 5.0

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

Firefox 102

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

Gecko driver 0.31.0.1

Are you using Selenium Grid?

no

@github-actions
Copy link

github-actions bot commented Jul 4, 2022

@TJay90, 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, MSEdgeDriver, 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!

@diemol diemol added I-issue-template Applied to issues not following the template, or missing information. and removed I-defect needs-triaging labels Jul 4, 2022
@github-actions
Copy link

github-actions bot commented Jul 4, 2022

Hi, @TJay90.
Please follow the issue template, we need more information to reproduce the issue.

Either a complete code snippet and URL/HTML (if more than one file is needed, provide a GitHub repo and instructions to run the code), the specific versions used, or a more detailed description to help us understand the issue.

Note: If you cannot share your code and URL/HTML, any complete code snippet and URL/HTML that reproduces the issue is good enough.

Reply to this issue when all information is provided, thank you.

@AutomatedTester
Copy link
Member

Can you create a brand new project that can create this issue? That error message suggests to me that Firefox was not able to start the port it needed on that machine to be able to work.

@whimboo
Copy link
Contributor

whimboo commented Jul 4, 2022

Otherwise please also create a Trace log which would be helpful to figure out what's going on. Feel free to only provide an excerpt for it until this error message. Thanks.

@TJay90
Copy link
Author

TJay90 commented Jul 4, 2022

Otherwise please also create a Trace log which would be helpful to figure out what's going on. Feel free to only provide an excerpt for it until this error message. Thanks.

Please find the stack trace log here:

Message: Test method UIAutomation.SpecFeatures.GetAStockQuote_Buy threw exception: System.InvalidOperationException: Error: NS_BINDING_ABORTED (SessionNotCreated) TestCleanup method UIAutomation.SpecFeatures.TestTearDown threw exception. System.NullReferenceException: System.NullReferenceException: Object reference not set to an instance of an object..

Stack Trace: RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary2 parameters)
RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
RemoteWebDriver.ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
FirefoxDriver.ctor(FirefoxDriverService service, FirefoxOptions options, TimeSpan commandTimeout)
FirefoxDriver.ctor(FirefoxOptions options)
GenericSpecStep._RunOnBrowser() line 171
GenericSpecStep.SetUp() line 89
TestExecutionEngine.FireEvents(HookType hookType)
TestExecutionEngine.FireScenarioEvents(HookType bindingEvent)
TestExecutionEngine.OnScenarioStart()
TestExecutionEngine.OnAfterLastStep()
TestRunner.CollectScenarioErrors()
Feature.ScenarioCleanup()
Feature.GetAStockQuote(String order, String[] exampleTags) line 16
Feature.GetAStockQuote_Buy() line 10
TestCleanup Stack Trace
CommonUtilities.CaptureScreenshot(String fileName, TestContext testContext, IWebDriver driver) line 21
GenericSpecStep.CleanUp() line 136
TestExecutionEngine.FireEvents(HookType hookType)
TestExecutionEngine.FireScenarioEvents(HookType bindingEvent)
TestExecutionEngine.OnScenarioEnd()
TestRunner.OnScenarioEnd()
Feature.TestTearDown()`

@whimboo
Copy link
Contributor

whimboo commented Jul 4, 2022

This is not a trace log that you posted. Please read the link that I provided again. Thanks.

@titusfortner
Copy link
Member

I can't reproduce this locally; everything is working for me with Firefox 102 on macOS with .NET 5 & Geckodriver 0.31

@vitalisc
Copy link

vitalisc commented Jul 7, 2022

I can't reproduce this locally; everything is working for me with Firefox 102 on macOS with .NET 5 & Geckodriver 0.31

can you paste your code here or try the below code

FirefoxDriver driver = null;

        var driverService = FirefoxDriverService.CreateDefaultService();

        
        FirefoxOptions FirefoxOptions = new FirefoxOptions();

        FirefoxOptions.AddArgument("start-maximized");
        driverService.HideCommandPromptWindow = true;

        driver = new FirefoxDriver(driverService, FirefoxOptions, TimeSpan.FromSeconds(220));
        driver.ExecuteScript("Object.defineProperty(navigator, 'webdriver', {get: () => undefined})");

@diemol
Copy link
Member

diemol commented Jul 7, 2022

@vitalisc please also create a Trace log which would be helpful to figure out what's going on. Feel free to only provide an excerpt for it until this error message. Thanks.

@titusfortner
Copy link
Member

@vitalisc

The options code needs to be:

FirefoxOptions.AddArgument("--start-maximized");

@lynhette
Copy link

Hello,
I have the same issue using firefox 102 instead of 101 but I am using Windows. Is this issue closed because of missing traces ? Did anyone have a solution for this issue ?
Thanks a lot

@diemol
Copy link
Member

diemol commented Jul 12, 2022

Yes, we are missing ways on how to reproduce this and no more information is being provided. So, a trace log as mentioned above is needed.

@lynhette
Copy link

I'm trying to enable the trace from the link you gave. But I have minimal info, is this OK ?
Capabilities
{acceptInsecureCerts: true, browserName: firefox, moz:firefoxOptions: {args: [ --disable-web-security, --start-maximized], log: {level: trace}, prefs: {media.eme.enabled: true, media.gmp-manager.updateEnabled: true}}, platform: ANY, version: }

Error: NS_BINDING_ABORTED
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'xxxxx', ip: 'xxxxxx', os.name: 'windows', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_301'
Driver info: driver.version: unknown
remote stacktrace: #checkLoadingState@chrome://remote/content/shared/Navigate.jsm:209:28
onStateChange@chrome://remote/content/shared/Navigate.jsm:254:28

@titusfortner
Copy link
Member

I closed this because the provided code worked when I updated the addArgument() argument value.

Things we need to reopen this issue:

  1. Update to the latest version of Selenium (we can't fix anything in an old version of Selenium)
  2. The Code you are using to start the session
  3. Error message and Stack Trace
  4. Geckodriver Logs: https://firefox-source-docs.mozilla.org/testing/geckodriver/TraceLogs.html

@joshhighet
Copy link

Hi there, I seem to be able to repro this - regardless of the start-maximized setting state.

The below (at-least for me, will return a similar issue to the above) - environment versions noted below

import logging
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from selenium.common.exceptions import WebDriverException

options = Options()
options.headless = True
options.set_preference('dom.max_script_run_time', 15)
options.add_argument("start-maximized")
options.log.level = "trace"
options.set_preference('network.http.timeout', 20000)
try:
    driver = webdriver.Firefox(options=options)
    driver.get('https://twitter.com')
    logging.debug(driver.page_source)
    source = driver.execute_script("return document.getElementsByTagName('html')[0].innerHTML")
except WebDriverException as e:
    logging.critical(str(e))
    exit()
driver.quit()
print(source)
python3 -c 'import selenium; print(selenium.__version__)'
4.0.0

geckodriver --version
geckodriver 0.31.0

/Applications/Firefox.app/Contents/MacOS/firefox-bin --full-version
Mozilla Firefox 102.0.1 20220705093820 20220705093820
geckodriver.log trace output, click-expand
1657775130572	geckodriver	INFO	Listening on 127.0.0.1:53668
1657775130575	geckodriver::capabilities	DEBUG	Trying to read firefox version from ini files
1657775130576	geckodriver::capabilities	DEBUG	Found version 102.0.1
1657775130581	mozrunner::runner	INFO	Running command: "/Applications/Firefox.app/Contents/MacOS/firefox-bin" "--marionette" "-headless" "start-maximized" "--remote-debugging-port" "53669" "--remote-allow-hosts" "localhost" "-foreground" "-no-remote" "-profile" "/var/folders/1c/9qlxg8ln30b82r6fjs47lscw0000gn/T/rust_mozprofileLtNhga"
1657775130581	geckodriver::marionette	DEBUG	Waiting 60s to connect to browser on 127.0.0.1
1657775130581	geckodriver::browser	TRACE	Failed to open /var/folders/1c/9qlxg8ln30b82r6fjs47lscw0000gn/T/rust_mozprofileLtNhga/MarionetteActivePort
1657775130582	geckodriver::marionette	TRACE	Retrying in 100ms
*** You are running in headless mode.
1657775130684	geckodriver::browser	TRACE	Failed to open /var/folders/1c/9qlxg8ln30b82r6fjs47lscw0000gn/T/rust_mozprofileLtNhga/MarionetteActivePort
1657775130684	geckodriver::marionette	TRACE	Retrying in 100ms
1657775130788	geckodriver::browser	TRACE	Failed to open /var/folders/1c/9qlxg8ln30b82r6fjs47lscw0000gn/T/rust_mozprofileLtNhga/MarionetteActivePort
1657775130788	geckodriver::marionette	TRACE	Retrying in 100ms
1657775130893	geckodriver::browser	TRACE	Failed to open /var/folders/1c/9qlxg8ln30b82r6fjs47lscw0000gn/T/rust_mozprofileLtNhga/MarionetteActivePort
1657775130893	geckodriver::marionette	TRACE	Retrying in 100ms
1657775130997	geckodriver::browser	TRACE	Failed to open /var/folders/1c/9qlxg8ln30b82r6fjs47lscw0000gn/T/rust_mozprofileLtNhga/MarionetteActivePort
1657775130997	geckodriver::marionette	TRACE	Retrying in 100ms
2022-07-14 17:05:31.002 plugin-container[26735:13811896] nil host used in call to allowsSpecificHTTPSCertificateForHost
2022-07-14 17:05:31.002 plugin-container[26735:13811896] nil host used in call to allowsAnyHTTPSCertificateForHost:
1657775131015	RemoteAgent	DEBUG	WebDriver BiDi enabled
1657775131015	RemoteAgent	DEBUG	CDP enabled
1657775131015	Marionette	INFO	Marionette enabled
1657775131016	RemoteAgent	DEBUG	Setting recommended pref apz.content_response_timeout to 60000
1657775131016	RemoteAgent	DEBUG	Setting recommended pref browser.contentblocking.introCount to 99
1657775131016	RemoteAgent	DEBUG	Setting recommended pref browser.download.panel.shown to true
1657775131016	RemoteAgent	DEBUG	Setting recommended pref browser.newtabpage.enabled to false
1657775131017	RemoteAgent	DEBUG	Setting recommended pref browser.pagethumbnails.capturing_disabled to true
1657775131017	RemoteAgent	DEBUG	Setting recommended pref browser.search.update to false
1657775131017	RemoteAgent	DEBUG	Setting recommended pref browser.startup.couldRestoreSession.count to -1
1657775131017	RemoteAgent	DEBUG	Setting recommended pref browser.tabs.closeWindowWithLastTab to false
1657775131017	RemoteAgent	DEBUG	Setting recommended pref browser.tabs.disableBackgroundZombification to false
1657775131017	RemoteAgent	DEBUG	Setting recommended pref browser.tabs.unloadOnLowMemory to false
1657775131017	RemoteAgent	DEBUG	Setting recommended pref browser.tabs.warnOnClose to false
1657775131017	RemoteAgent	DEBUG	Setting recommended pref browser.tabs.warnOnCloseOtherTabs to false
1657775131017	RemoteAgent	DEBUG	Setting recommended pref browser.tabs.warnOnOpen to false
1657775131017	RemoteAgent	DEBUG	Setting recommended pref browser.toolbars.bookmarks.visibility to never
1657775131017	RemoteAgent	DEBUG	Setting recommended pref browser.usedOnWindows10.introURL to 
1657775131017	RemoteAgent	DEBUG	Setting recommended pref browser.urlbar.merino.endpointURL to 
1657775131017	RemoteAgent	DEBUG	Setting recommended pref browser.urlbar.suggest.searches to false
1657775131017	RemoteAgent	DEBUG	Setting recommended pref datareporting.policy.dataSubmissionPolicyAccepted to false
1657775131017	RemoteAgent	DEBUG	Setting recommended pref dom.disable_open_during_load to false
1657775131017	RemoteAgent	DEBUG	Setting recommended pref dom.file.createInChild to true
1657775131017	RemoteAgent	DEBUG	Setting recommended pref dom.max_chrome_script_run_time to 0
1657775131018	RemoteAgent	DEBUG	Setting recommended pref dom.push.connection.enabled to false
1657775131018	RemoteAgent	DEBUG	Setting recommended pref dom.successive_dialog_time_limit to 0
1657775131018	RemoteAgent	DEBUG	Setting recommended pref extensions.getAddons.cache.enabled to false
1657775131018	RemoteAgent	DEBUG	Setting recommended pref extensions.getAddons.discovery.api_url to data:, 
1657775131018	RemoteAgent	DEBUG	Setting recommended pref network.http.phishy-userpass-length to 255
1657775131018	RemoteAgent	DEBUG	Setting recommended pref network.http.prompt-temp-redirect to false
1657775131018	RemoteAgent	DEBUG	Setting recommended pref privacy.trackingprotection.enabled to false
1657775131018	RemoteAgent	DEBUG	Setting recommended pref security.fileuri.strict_origin_policy to false
1657775131018	RemoteAgent	DEBUG	Setting recommended pref security.notification_enable_delay to 0
1657775131018	RemoteAgent	DEBUG	Setting recommended pref signon.autofillForms to false
1657775131018	RemoteAgent	DEBUG	Setting recommended pref signon.rememberSignons to false
1657775131018	RemoteAgent	DEBUG	Setting recommended pref browser.topsites.contile.enabled to false
1657775131018	RemoteAgent	DEBUG	Setting recommended pref dom.disable_beforeunload to true
1657775131035	Marionette	TRACE	Received observer notification final-ui-startup
1657775131036	Marionette	INFO	Listening on port 53674
1657775131036	Marionette	DEBUG	Marionette is listening
1657775131036	RemoteAgent	TRACE	Received observer notification final-ui-startup
WebDriver BiDi listening on ws://localhost:53669
1657775131041	RemoteAgent	DEBUG	Setting recommended pref browser.contentblocking.features.standard to -tp,tpPrivate,cookieBehavior0,-cm,-fp
1657775131041	RemoteAgent	DEBUG	Setting recommended pref network.cookie.cookieBehavior to 0
2022-07-14 17:05:31.048 plugin-container[26735:13811896] nil host used in call to allowsSpecificHTTPSCertificateForHost
2022-07-14 17:05:31.048 plugin-container[26735:13811896] nil host used in call to allowsAnyHTTPSCertificateForHost:
2022-07-14 17:05:31.048 plugin-container[26735:13811894] nil host used in call to allowsSpecificHTTPSCertificateForHost
2022-07-14 17:05:31.048 plugin-container[26735:13811894] nil host used in call to allowsAnyHTTPSCertificateForHost:
Read port: 53674
1657775131102	CDP	DEBUG	Waiting for initial application window
1657775131280	Marionette	DEBUG	Accepted connection 0 from 127.0.0.1:53675
1657775131282	geckodriver::marionette	DEBUG	Connection to Marionette established on 127.0.0.1:53674.
1657775131409	Marionette	DEBUG	0 -> [0,1,"WebDriver:NewSession",{"acceptInsecureCerts":true,"browserName":"firefox","pageLoadStrategy":"normal"}]
1657775131411	RemoteAgent	WARN	TLS certificate errors will be ignored for this session
1657775131421	Marionette	DEBUG	Waiting for initial application window
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
1657775131892	RemoteAgent	TRACE	Received DOM event load for [object HTMLDocument]
console.warn: SearchSettings: "get: No settings file exists, new profile?" (new NotFoundError("Could not open the file at /var/folders/1c/9qlxg8ln30b82r6fjs47lscw0000gn/T/rust_mozprofileLtNhga/search.json.mozlz4", (void 0)))
1657775132562	Marionette	TRACE	Received observer notification browser-idle-startup-tasks-finished
1657775132562	RemoteAgent	TRACE	Received observer notification browser-idle-startup-tasks-finished
DevTools listening on ws://localhost:53669/devtools/browser/c7f95f0f-49ad-4286-8628-ad9a44154713
1657775132565	RemoteAgent	TRACE	[22] ProgressListener state=start: https://www.start-maximized.com/
1657775133260	RemoteAgent	TRACE	[22] ProgressListener state=stop: error=0x804b0002 (NS_BINDING_ABORTED)
1657775133260	Marionette	DEBUG	0 <- [1,1,{"error":"session not created","message":"Error: NS_BINDING_ABORTED","stacktrace":"#checkLoadingState@chrome://remote/content/shared/Navigate.jsm:209:28\nonStateChange@chrome://remote/content/shared/Navigate.jsm:254:28\n"},null]
1657775133274	webdriver::server	DEBUG	Teardown session
1657775133274	mozrunner::runner	DEBUG	Killing process 26733
Exiting due to channel error.
Exiting due to channel error.
[GFX1-]: Receive IPC close with reason=AbnormalShutdown
Exiting due to channel error.
1657775133324	webdriver::server	DEBUG	<- 500 Internal Server Error {"value":{"error":"session not created","message":"Error: NS_BINDING_ABORTED","stacktrace":"#checkLoadingState@chrome://remote/content/shared/Navigate.jsm:209:28\nonStateChange@chrome://remote/content/shared/Navigate.jsm:254:28\n"}}

Any thoughts on what might have gone wrong (or workarounds!) greatly appreciated

@titusfortner titusfortner reopened this Jul 14, 2022
@whimboo
Copy link
Contributor

whimboo commented Jul 15, 2022

Note that Firefox doesn't have a start-maximized command line argument but actually interprets it as the URL to open on startup (instead of about:blank). Internally start-maximized get completed to https://www.start-maximized.com/. This gets forward to some random page at least for me and then ends-up in a network error. Exactly this is what the NS_BINDING_ABORTED stands for.

As workaround remove start-maximized from the arguments and the problem will disappear.

For the underlying problem I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1779723 to get it fixed in Firefox.

I think that we can close this issue given that it's not Selenium which misbehaves here.

@diemol
Copy link
Member

diemol commented Jul 15, 2022

Thanks for letting us know, @whimboo!

@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 Aug 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I-issue-template Applied to issues not following the template, or missing information. R-awaiting answer
Projects
None yet
Development

No branches or pull requests

8 participants