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]: Add argument for websocket-port #15451

Open
titusfortner opened this issue Mar 18, 2025 · 4 comments · Fixed by #15557
Open

[🐛 Bug]: Add argument for websocket-port #15451

titusfortner opened this issue Mar 18, 2025 · 4 comments · Fixed by #15557
Labels
C-java Java Bindings C-rb Ruby Bindings I-defect Something is not working as intended

Comments

@titusfortner
Copy link
Member

What happened?

Mozilla recently changed how it handles multiple sessions on the same geckodriver. We can avoid this by passing in a unique / available port with websocket-port argument.

Python and .NET do this already, but only when there is a flag to reuse the driver, and I'm not sure it makes sense to hide it behind that flag now, but I haven't spent time working with the logic.

See
mozilla/geckodriver#2219
and
mozilla/geckodriver#2218

How can we reproduce the issue?

see referenced issues above

Relevant log output

see referenced issues above

Operating System

n/a

Selenium version

trunk

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

Firefox 136

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

Geckodriver 0.36

Are you using Selenium Grid?

No response

@titusfortner titusfortner added C-dotnet .NET Bindings C-java Java Bindings C-nodejs JavaScript Bindings C-py Python Bindings C-rb Ruby Bindings I-defect Something is not working as intended labels Mar 18, 2025
@cgoldberg
Copy link
Contributor

I can fix Python... it looks like it gets set to a free port only if you pass the --connect-existing arg. So I guess I'll just remove that so it always sets the port. I don't see that flag anywhere else in the Python codebase, and I'm not sure how users are supposed to know about it anyway.

I'll link a PR in a few minutes.

@cgoldberg
Copy link
Contributor

cgoldberg commented Mar 18, 2025

Here's the Python PR: #15452
I haven't tested it yet.

@titusfortner titusfortner removed C-py Python Bindings C-dotnet .NET Bindings labels Mar 18, 2025
@titusfortner
Copy link
Member Author

Re-reading the actual code, Python & .NET seem to be doing the right thing already, they always send the websocket port unless the user passes a flag explicitly requesting to reuse the driver instance to create a new session.

So the real issue is getting the other bindings to add the toggle and the code to always add the socket port.

@joerg1985
Copy link
Member

joerg1985 commented Mar 19, 2025

@titusfortner will -websocket-port 0 work to auto select a free port? Issue #14928 does ask to change the --port to this to speedup things. In case this will not work for --websocket is there a chance to make firefox implement this?

EDIT: will ask this in the geckodriver issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment