Sha256: 116b55ed9d276071b4ab6506b405de483f16641e15d3927e62840197ff268c9b

Contents?: true

Size: 868 Bytes

Versions: 15

Compression:

Stored size: 868 Bytes

Contents

module Selenium
  module RemoteControl
    
    class RemoteControl
      attr_reader :host, :port, :timeout_in_seconds
      attr_accessor :additional_args, :jar_file
      
      def initialize(host, port, timeout_in_seconds = 2 * 60)
        @host, @port, @timeout_in_seconds = host, port, timeout_in_seconds
        @additional_args = []
        @shell = Nautilus::Shell.new
      end
      
      def start(options = {})
        command = "java -jar \"#{jar_file}\""
        command << " -port #{@port}"
        command << " -timeout #{@timeout_in_seconds}"
        command << " #{additional_args.join(' ')}" unless additional_args.empty?
        
        @shell.run command, {:background => options[:background]}
      end
      
      def stop
        Net::HTTP.get(@host, '/selenium-server/driver/?cmd=shutDown', @port)
      end
      
    end
    
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
selenium-client-1.2.1 lib/selenium/remote_control/remote_control.rb
selenium-client-1.2.10 lib/selenium/remote_control/remote_control.rb
selenium-client-1.2.13 lib/selenium/remote_control/remote_control.rb
selenium-client-1.2.3 lib/selenium/remote_control/remote_control.rb
selenium-client-1.2 lib/selenium/remote_control/remote_control.rb
selenium-client-1.2.4 lib/selenium/remote_control/remote_control.rb
selenium-client-1.2.6 lib/selenium/remote_control/remote_control.rb
selenium-client-1.2.11 lib/selenium/remote_control/remote_control.rb
selenium-client-1.2.12 lib/selenium/remote_control/remote_control.rb
selenium-client-1.2.5 lib/selenium/remote_control/remote_control.rb
selenium-client-1.2.7 lib/selenium/remote_control/remote_control.rb
selenium-client-1.2.8 lib/selenium/remote_control/remote_control.rb
selenium-client-1.2.14 lib/selenium/remote_control/remote_control.rb
selenium-client-1.2.2 lib/selenium/remote_control/remote_control.rb
selenium-client-1.2.9 lib/selenium/remote_control/remote_control.rb