Switch over to use the net-http-persistent gem for keep-alives with the WebDriver
Fixes #36
This commit is contained in:
parent
fe817e3f87
commit
8ecef8f3f6
|
@ -1,6 +1,8 @@
|
|||
require "selenium/client"
|
||||
require "selenium/webdriver"
|
||||
|
||||
require 'selenium/webdriver/remote/http/persistent'
|
||||
|
||||
module Sauce
|
||||
class Selenium < ::Selenium::Client::Driver
|
||||
def initialize(opts={})
|
||||
|
@ -21,7 +23,7 @@ module Sauce
|
|||
class Selenium2
|
||||
def initialize(opts={})
|
||||
@config = Sauce::Config.new(opts)
|
||||
http_client = ::Selenium::WebDriver::Remote::Http::Default.new
|
||||
http_client = ::Selenium::WebDriver::Remote::Http::Persistent.new
|
||||
http_client.timeout = 300 # Browser launch can take a while
|
||||
@driver = ::Selenium::WebDriver.for(:remote, :url => "http://#{@config.username}:#{@config.access_key}@#{@config.host}:#{@config.port}/wd/hub", :desired_capabilities => @config.to_desired_capabilities, :http_client => http_client)
|
||||
http_client.timeout = 90 # Once the browser is up, commands should time out reasonably
|
||||
|
|
|
@ -34,6 +34,7 @@ Gem::Specification.new do |s|
|
|||
s.add_development_dependency('rake')
|
||||
s.add_development_dependency('bundler')
|
||||
s.add_development_dependency('rspec')
|
||||
s.add_dependency('net-http-persistent')
|
||||
|
||||
if s.respond_to? :specification_version then
|
||||
s.specification_version = 3
|
||||
|
|
Loading…
Reference in New Issue