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]: FirefoxDriverService.cs one line change breaks geckodriver ConnectToRunningBrowser

See original GitHub issue

What happened?

[dotnet] Add --websocket-port command line argument for geckodriver argsBuilder.Append(string.Format(CultureInfo.InvariantCulture, " --websocket-port {0}", PortUtilities.FindFreePort()));

This breaks the firefoxdriver ability to connect to an already open browser when using --connect-existing.

geckodriver: The argument ā€˜ā€“connect-existingā€™ cannot be used with 'ā€“websocket-port

The websocket-port should not be blindly added when all the other parms are conditionalā€¦

How can we reproduce the issue?

FirefoxDriverService firefoxDriverService = FirefoxDriverService.CreateDefaultService(browserSettings.DriverLocation);
                    firefoxDriverService.HideCommandPromptWindow = false;
                    firefoxDriverService.Port = 0;
                    firefoxDriverService.BrowserCommunicationPort = 2828;
                    firefoxDriverService.Host = "127.0.0.1";
                    firefoxDriverService.ConnectToRunningBrowser = true;
                    var tmpDriver = new FirefoxDriver(firefoxDriverService, ffOptions);

Relevant log output

geckodriver: The argument '--connect-existing' cannot be used with '--websocket-port

Operating System

win 10

Selenium version

latest

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

firefox

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

most recent geckodriver

Are you using Selenium Grid?

No response

Issue Analytics

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

github_iconTop GitHub Comments

5reactions
deadmikecommented, Dec 15, 2021

@jimevans I didnā€™t state any malice. Intentional is exactly what the change was, however the implementation was flawed.

iā€™ve developed code since 1986, itā€™s why I know about this bug. every single bug iā€™ve ever written and will write is all intentional, never any malice implied, but honestly speaking, every bug is intended for some purpose that it misses to fulfill. the code is intentionally written, albeit without me realizing it was buggy.

3reactions
jimevanscommented, Dec 15, 2021

Okay, yes, I see that itā€™s a bug. Contrary to @deadmikeā€˜s assertion, this break was not intentional; it was done inadvertently with a misunderstanding of how the bidi port should be applied. Without it, none of the new Selenium 4 bidi-based features (network interception, JavaScript console monitoring, etc.) will work for Firefox. Iā€™m sure youā€™re willing to live with the trade off, so Iā€™ll reopen the issue. I get the frustration, but the assertion of malice and intent, and the accompanying tone, is entirely unwarranted.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Selenium using Python - Geckodriver executable needs to be ...
The following command not only installs it, but it also puts it in the executable PATH . sudo apt install firefox-geckodriver. The problem...
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