Skip to content

Instantly share code, notes, and snippets.

@kshep
Created July 13, 2011 15:02
Show Gist options
  • Save kshep/1080475 to your computer and use it in GitHub Desktop.
Save kshep/1080475 to your computer and use it in GitHub Desktop.
chromedriver test
First, changed the response_for method in lib/selenium/webdriver/remote/http/default.rb to
72 def response_for(request)
73 http.set_debug_output $stdout ### KSHEP
74 http.request request
75 end
Then...
---
% cat chromedriver_test
#!/usr/bin/env ruby
require 'rubygems'
require 'selenium-webdriver'
d1 = Selenium::WebDriver.for :chrome
d1.get "http://google.com"
d1.quit
% ./chromedriver_test
opening connection to 127.0.0.1...
opened
<- "POST /session HTTP/1.1\r\nAccept: application/json\r\nConnection: close\r\nContent-Type: application/json; charset=utf-8\r\nContent-Length: 193\r\nHost: 127.0.0.1:52132\r\n\r\n"
<- "{\"desiredCapabilities\":{\"javascriptEnabled\":true,\"version\":\"\",\"rotatable\":false,\"takesScreenshot\":false,\"cssSelectorsEnabled\":true,\"browserName\":\"chrome\",\"nativeEvents\":false,\"platform\":\"ANY\"}}"
-> "HTTP/1.1 401 Unauthorized\r\n"
-> "WWW-Authenticate: Digest qop=\"auth\", realm=\"mydomain.com\", nonce=\"1310569216\"\r\n"
-> "\r\n"
reading all...
-> ""
read 0 bytes
Conn close
/Users/change/.rvm/gems/ree-1.8.7-2010.02/gems/selenium-webdriver-0.2.1/lib/selenium/webdriver/remote/http/common.rb:66:in `create_response': unexpected response, code=401, content-type="" (Selenium::WebDriver::Error::WebDriverError)
from /Users/change/.rvm/gems/ree-1.8.7-2010.02/gems/selenium-webdriver-0.2.1/lib/selenium/webdriver/remote/http/default.rb:56:in `request'
from /Users/change/.rvm/gems/ree-1.8.7-2010.02/gems/selenium-webdriver-0.2.1/lib/selenium/webdriver/remote/http/common.rb:40:in `call'
from /Users/change/.rvm/gems/ree-1.8.7-2010.02/gems/selenium-webdriver-0.2.1/lib/selenium/webdriver/remote/bridge.rb:477:in `raw_execute'
from /Users/change/.rvm/gems/ree-1.8.7-2010.02/gems/selenium-webdriver-0.2.1/lib/selenium/webdriver/remote/bridge.rb:88:in `create_session'
from /Users/change/.rvm/gems/ree-1.8.7-2010.02/gems/selenium-webdriver-0.2.1/lib/selenium/webdriver/remote/bridge.rb:68:in `initialize'
from /Users/change/.rvm/gems/ree-1.8.7-2010.02/gems/selenium-webdriver-0.2.1/lib/selenium/webdriver/chrome/bridge.rb:37:in `initialize'
from /Users/change/.rvm/gems/ree-1.8.7-2010.02/gems/selenium-webdriver-0.2.1/lib/selenium/webdriver/common/driver.rb:33:in `new'
from /Users/change/.rvm/gems/ree-1.8.7-2010.02/gems/selenium-webdriver-0.2.1/lib/selenium/webdriver/common/driver.rb:33:in `for'
from /Users/change/.rvm/gems/ree-1.8.7-2010.02/gems/selenium-webdriver-0.2.1/lib/selenium/webdriver.rb:74:in `for'
from ./chromedriver_test:6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment