Class Selenium::RemoteControl::RemoteControl
In: lib/selenium/remote_control/remote_control.rb
Parent: Object

Methods

new   start   stop  

Attributes

additional_args  [RW] 
host  [R] 
jar_file  [RW] 
log_to  [RW] 
port  [R] 
shutdown_command  [R] 
timeout_in_seconds  [R] 

Public Class methods

[Source]

    # File lib/selenium/remote_control/remote_control.rb, line 8
 8:       def initialize(host, port, options={})
 9:         @host, @port = host, port
10:         @timeout_in_seconds = options[:timeout] || (2 * 60)
11:         @shutdown_command = options[:shutdown_command] || "shutDownSeleniumServer"
12:         @additional_args = []
13:         @shell = Nautilus::Shell.new
14:       end

Public Instance methods

[Source]

    # File lib/selenium/remote_control/remote_control.rb, line 16
16:       def start(options = {})
17:         command = "java -jar \"#{jar_file}\""
18:         command << " -port #{@port}"
19:         command << " -timeout #{@timeout_in_seconds}"
20:         command << " #{additional_args.join(' ')}" unless additional_args.empty?
21:         command << " > #{log_to}" if log_to
22:         
23:         @shell.run command, {:background => options[:background]}
24:       end

[Source]

    # File lib/selenium/remote_control/remote_control.rb, line 26
26:       def stop
27:         Net::HTTP.get(@host, "/selenium-server/driver/?cmd=#{shutdown_command}", @port)
28:       end

[Validate]