title: Selenium WebDriver for ruby fails with "too many redirects"
body: <p>I've got this simple test case that tests a login form.
  For some reason webdriver refuses to run the test and comes back with a "too many redirects" message. The page is just an ordinary login screen, very simple and there are no redirects whatsoever. Access from the server to the page seems ok.</p>
  
  <p>I'm using selenium-webdriver-2.25.0 on a centos server.  </p>
  
  <p>Below the error message:</p>
  
  <pre><code>(...)
  
  [WARNING] MultiJson is using the default adapter (ok_json). We recommend loading a different JSON library to improve performance.
  EE
  Finished in 0.206445 seconds.
  
  1) Error: test_login(Login):
  Selenium::WebDriver::Error::WebDriverError: too many redirects
  /usr/lib/ruby/gems/1.8/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/remote/http/default.rb:62:in `request'
  /usr/lib/ruby/gems/1.8/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/remote/http/default.rb:63:in `request'
  /usr/lib/ruby/gems/1.8/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/remote/http/common.rb:40:in `call'
  
  (...)
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>require "rubygems"
  require "selenium-webdriver"
  require "test/unit"
  
  class Login &lt; Test::Unit::TestCase
  
    def setup
      @driver =Selenium::WebDriver.for(:remote, :url =&gt; "http://selenium.server.com/wd/hub")
      @base_url = "http://www.myservice.com"
      @driver.manage.timeouts.implicit_wait = 30
      @verification_errors = []
    end
  
    def teardown
      @driver.quit
      assert_equal [], @verification_errors
    end
  
    def test_login
      @driver.get(@base_url + "/login/")
      @driver.find_element(:id, "username").clear
      @driver.find_element(:id, "username").send_keys "user@server"
      @driver.find_element(:id, "password").clear
      @driver.find_element(:id, "password").send_keys "mykeys!"
      @driver.find_element(:xpath, "//input[@value='Login']").click
      verify { assert element_present?(:link, "Logout") }
      verify { assert element_present?(:link, "Settings") }
      verify { assert element_present?(:link, "Products") }
    end
  
    def element_present?(how, what)
      @driver.find_element(how, what)
      true
    rescue Selenium::WebDriver::Error::NoSuchElementError
      false
    end
  
    def verify(&amp;blk)
      yield
    rescue Test::Unit::AssertionFailedError =&gt; ex
      @verificatiohttp://jenkins.dev.emesa-auctions.com/cms/n_errors &lt;&lt; ex
    end
  end
  </code></pre>
  
  <h1>UPDATE</h1>
  
  <p>It seems that no matter what url I use for the 'base url' the errors keeps occuring.</p>