[🐛 Bug]: Informed driver port not being used - The port minus one is the port being used. Why?
See original GitHub issueWhat happened?
The selected port for the ChromeDriver doesn’t look right.
Why the port selected by the ChromeDriver receives a - 1
?
def socket_lock
@socket_lock ||= SocketLock.new(@port - 1, SOCKET_LOCK_TIMEOUT)
end
I took a look at the documentation, but I couldn’t find a reason.
How can we reproduce the issue?
Start a ChromeDriver by choosing a busy port.
Example
For this example, we’re choosing port 9999.
First, let’s make the port 9998 busy (port 9999 - 1)
python -m SimpleHTTPServer 9998
Second, let’s try to instantiate the ChromeDriver in the port 9999
driver = Selenium::WebDriver.for(:chrome, service:
Selenium::WebDriver::Chrome::Service.chrome(port: 9999))
Relevant log output
Operating System
Ubuntu 18.04
Selenium version
4.0.3
What are the browser(s) and version(s) where you see this issue?
N/A
What are the browser driver(s) and version(s) where you see this issue?
N/A
Are you using Selenium Grid?
No
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
COM ports Windows 10: fix any COM port issues in 2 easy ways
We are going to show you two different methods you can use to add COM ports to Windows 10. One is a procedure...
Read more >516 Port refresh not working on USB-serial port - YAT
Auto-refresh should work on USB driver based COM ports. ... without closing the port may result in the port no longer being usable....
Read more >Troubleshooting Port Problems - InformIT
Troubleshooting Port Problems. Failures of the serial, parallel, and game ports tend to end with poor or no operation of the peripheral.
Read more >TCP and UDP port usage
How to enforce? - Recall every packet in TCP flow except first has ACK. - Block incoming TCP packets w. SYN flag but...
Read more >Initializing the Driver - PostgreSQL JDBC Driver
Defaults to the PostgreSQL® standard port number (5432). database = The database name ... This property is no longer used by the driver...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah, what we’re doing is locking the
port - 1
withSocketLock#lock
and then usingPortProber#above
to find the next available port to start the driver. This typically works fine because the port below the default ports is usually available.I’m not sure why we do it this way, though. @twalpole or @p0deje do you have insight on this?
Bottom line is that Selenium will use the provided port, but you need to have the port below it available as well.
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.