title: Selenium RC error unknown protocol: localhost
body: <p>I just begin to start use Selenium with Ruby on Rails 3, I have my code as</p>
  
  <pre><code>before(:all) do
    @verification_errors = []
    @selenium_driver = Selenium::Client::Driver.new \
      :host =&gt; "localhost",
      :port =&gt; 2195,
      :browser =&gt; "*firefox C:/Program Files (x86)/Mozilla Firefox/firefox.exe",
      :url =&gt; "localhost:3000",
      :timeout_in_second =&gt; 60
  
    @selenium_driver.start_new_browser_session
  end
  
  after(:all) do
    @selenium_driver.close_current_browser_session
    @verification_errors.should == []
  end
  
  it "should open the create new user page" do
    page.open "http://localhost:3000/"
    !page.is_text_present("translation missing").should be_false
    page.click "link=Register"
    page.wait_for_page_to_load "30000"
    !page.is_text_present("translation missing").should be_false
    page.is_text_present("New Account").should be_true
  end
  </code></pre>
  
  <p>But when I'm trying to run them, I got </p>
  
  <pre><code>11:02:29.118 INFO - Command request: getNewBrowserSession[*firefox C:/Program Files (x86)/Mozilla Firefox/firefox.exe, localhost:3000, , ] on session null
  11:02:29.118 INFO - creating new remote session
  11:02:29.119 INFO - Allocated session 5cbd2c60271b490ea90eccb193cb1d84 for localhost:3000, launching...
  11:02:29.119 ERROR - Failed to start new browser session, shutdown browser and clear all session data
  java.lang.RuntimeException: java.net.MalformedURLException: unknown protocol: localhost
      at org.openqa.selenium.net.Urls.toProtocolHostAndPort(Urls.java:32)
      at org.openqa.selenium.browserlaunchers.LauncherUtils.getDefaultRemoteSessionUrl(LauncherUtils.java:121)
      at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.launchRemoteSession(FirefoxChromeLauncher.java:413)
      at org.openqa.selenium.server.browserlaunchers.FirefoxLauncher.launchRemoteSession(FirefoxLauncher.java:110)
      at org.openqa.selenium.server.BrowserSessionFactory.createNewRemoteSession(BrowserSessionFactory.java:373)
      at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:125)
      at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:87)
      at org.openqa.selenium.server.SeleniumDriverResourceHandler.getNewBrowserSession(SeleniumDriverResourceHandler.java:786)
      at org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(SeleniumDriverResourceHandler.java:423)
      at org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandRequest(SeleniumDriverResourceHandler.java:394)
      at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java:147)
      at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1530)
      at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1482)
      at org.openqa.jetty.http.HttpServer.service(HttpServer.java:909)
      at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)
      at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986)
      at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)
      at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:243)
      at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:357)
      at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
  Caused by: java.net.MalformedURLException: unknown protocol: localhost
      at java.net.URL.&lt;init&gt;(Unknown Source)
      at java.net.URL.&lt;init&gt;(Unknown Source)
      at java.net.URL.&lt;init&gt;(Unknown Source)
      at org.openqa.selenium.net.Urls.toProtocolHostAndPort(Urls.java:24)
      ... 19 more
  11:02:29.121 INFO - Got result: Failed to start new browser session: Error while launching browser on session null
  </code></pre>
  
  <p>I didn't understand how come localhost become an unknown protocol, and I didn't find much help by my own searching.</p>
  
  <p>Can someone help me please, thanks in advance</p>