Skip to content

Commit 1b5aebe

Browse files
committed
rb - allow remote bridges to set port for server running on local host
1 parent 56d669e commit 1b5aebe

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

rb/lib/selenium/webdriver/remote/bridge.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,10 @@ def self.command(name, verb, url)
6262
def initialize(opts = {})
6363
opts = opts.dup
6464

65+
port = opts.delete(:port) || 4444
6566
http_client = opts.delete(:http_client) { Http::Default.new }
6667
desired_capabilities = opts.delete(:desired_capabilities) { Capabilities.firefox }
67-
url = opts.delete(:url) { "http://#{Platform.localhost}:4444/wd/hub" }
68+
url = opts.delete(:url) { "http://#{Platform.localhost}:#{port}/wd/hub" }
6869

6970
unless opts.empty?
7071
raise ArgumentError, "unknown option#{'s' if opts.size != 1}: #{opts.inspect}"

rb/lib/selenium/webdriver/remote/w3c_bridge.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@ def initialize(opts = {})
6767

6868
opts = opts.dup
6969

70+
port = opts.delete(:port) || 4444
7071
http_client = opts.delete(:http_client) { Http::Default.new }
7172
desired_capabilities = opts.delete(:desired_capabilities) { W3CCapabilities.firefox }
72-
url = opts.delete(:url) { "http://#{Platform.localhost}:4444/wd/hub" }
73+
url = opts.delete(:url) { "http://#{Platform.localhost}:#{port}/wd/hub" }
7374

7475
desired_capabilities = W3CCapabilities.send(desired_capabilities) if desired_capabilities.is_a? Symbol
7576

0 commit comments

Comments
 (0)