Skip to content

Commit fea7c9d

Browse files
committed
[rb] server class use a port prober instead of hard coding default port
1 parent e951100 commit fea7c9d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rb/lib/selenium/server.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
# under the License.
1919

2020
require 'selenium/webdriver/common/child_process'
21+
require 'selenium/webdriver/common/port_prober'
2122
require 'selenium/webdriver/common/socket_poller'
2223
require 'net/http'
2324

@@ -185,7 +186,7 @@ def initialize(jar, opts = {})
185186
@jar = jar
186187
@host = '127.0.0.1'
187188
@role = opts.fetch(:role, 'standalone')
188-
@port = opts.fetch(:port, 4444)
189+
@port = opts.fetch(:port, WebDriver::PortProber.above(4444))
189190
@timeout = opts.fetch(:timeout, 30)
190191
@background = opts.fetch(:background, false)
191192
@additional_args = opts.fetch(:args, [])

0 commit comments

Comments
 (0)