From b766091009912fb7086250c9cdd6208b5d68c71d Mon Sep 17 00:00:00 2001 From: Martin Kleppmann Date: Sun, 5 Jul 2009 01:48:35 +0100 Subject: [PATCH] Override host and port no matter what the arguments of getNewBrowserSession --- lib/selenium/client/base.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/selenium/client/base.rb b/lib/selenium/client/base.rb index 47d6950..a8a6127 100644 --- a/lib/selenium/client/base.rb +++ b/lib/selenium/client/base.rb @@ -48,8 +48,8 @@ module Base def initialize(*args) if args[0].kind_of?(Hash) options = args[0] - @host = 'localhost' # options[:host] - @port = java.lang.System.getProperty('selenium.client.port').to_i # options[:port].to_i + @host = options[:host] + @port = options[:port].to_i @browser_string = options[:browser] @browser_url = options[:url] @default_timeout_in_seconds = (options[:timeout_in_seconds] || 300).to_i @@ -65,6 +65,10 @@ def initialize(*args) @highlight_located_element_by_default = false end + # Override any script-supplied host and port + @host = 'localhost' + @port = java.lang.System.getProperty('selenium.client.port').to_i + @extension_js = "" @session_id = nil end