| Class | Selenium::Rake::RemoteControlStartTask |
| In: |
lib/selenium/rake/remote_control_start_task.rb
|
| Parent: | Object |
Rake tasks to start a Remote Control server.
require ‘selenium/rake/tasks‘
Selenium::Rake::RemoteControlStartTask.new do |rc|
rc.port = 4444 rc.timeout_in_seconds = 3 * 60 rc.background = true rc.wait_until_up_and_running = true rc.jar_file = "/path/to/where/selenium-rc-standalone-jar-is-installed" rc.additional_args << "-singleWindow"
end
If you do not explicitly specify the path to selenium remote control jar it will be "auto-discovered" in `vendor` directory using the following path : `vendor/selenium-remote-control/selenium-server*-standalone.jar`
To leverage the latest selenium-client capabilities, you may need to download a recent nightly build of a standalone packaging of Selenium Remote Control. You will find the nightly build at nexus.openqa.org/content/repositories/snapshots/org/seleniumhq/selenium/server/selenium-server/
| additional_args | [RW] | |
| background | [RW] | |
| jar_file | [R] | |
| log_to | [RW] | |
| port | [RW] | |
| timeout_in_seconds | [RW] | |
| wait_until_up_and_running | [RW] |
# File lib/selenium/rake/remote_control_start_task.rb, line 31
31: def initialize(name = 'selenium:rc:start''selenium:rc:start')
32: @name = name
33: @port = 4444
34: @timeout_in_seconds = 5
35: project_specific_jar = Dir["vendor/selenium-remote-control/selenium-server*-standalone.jar"].first
36: @jar_file = project_specific_jar
37: @additional_args = []
38: @background = false
39: @wait_until_up_and_running = false
40: yield self if block_given?
41: define
42: end
# File lib/selenium/rake/remote_control_start_task.rb, line 48
48: def define
49: desc "Launch Selenium Remote Control"
50: task @name do
51: puts "Starting Selenium Remote Control at 0.0.0.0:#{@port}..."
52: remote_control = Selenium::RemoteControl::RemoteControl.new("0.0.0.0", @port, @timeout_in_seconds)
53: remote_control.jar_file = @jar_file
54: remote_control.additional_args = @additional_args
55: remote_control.log_to = @log_to
56: remote_control.start :background => @background
57: if @background && @wait_until_up_and_running
58: puts "Waiting for Remote Control to be up and running..."
59: TCPSocket.wait_for_service :host => @host, :port => @port
60: end
61: puts "Selenium Remote Control at 0.0.0.0:#{@port} ready"
62: end
63: end