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