lib/selenium/remote_control/remote_control.rb in selenium-client-1.2.15 vs lib/selenium/remote_control/remote_control.rb in selenium-client-1.2.16

- old
+ new

@@ -1,14 +1,16 @@ module Selenium module RemoteControl class RemoteControl - attr_reader :host, :port, :timeout_in_seconds + attr_reader :host, :port, :timeout_in_seconds, :shutdown_command attr_accessor :additional_args, :jar_file, :log_to - def initialize(host, port, timeout_in_seconds = 2 * 60) - @host, @port, @timeout_in_seconds = host, port, timeout_in_seconds + def initialize(host, port, options={}) + @host, @port = host, port + @timeout_in_seconds = options[:timeout] || (2 * 60) + @shutdown_command = options[:shutdown_command] || "shutDownSeleniumServer" @additional_args = [] @shell = Nautilus::Shell.new end def start(options = {}) @@ -20,10 +22,10 @@ @shell.run command, {:background => options[:background]} end def stop - Net::HTTP.get(@host, '/selenium-server/driver/?cmd=shutDown', @port) + Net::HTTP.get(@host, "/selenium-server/driver/?cmd=#{shutdown_command}", @port) end end end