title: EOFError: end of file reached error using selenium android WebDriver
body: <p>I'm trying to get the Selenium Android WebDriver working with Rspec in order to test our Rails mobile application through an Android emulator. </p>
  
  <p>I've followed the <a href="https://code.google.com/p/selenium/wiki/AndroidDriver" rel="nofollow noreferrer">setup instructions</a> and have a test running with the following code:</p>
  
  <pre><code>driver = Selenium::WebDriver.for :android
  driver.navigate.to "http://google.com"
  
  element = driver.find_element(:name, 'q')
  element.send_keys "Hello WebDriver!"
  element.submit
  
  puts driver.title
  
  driver.quit
  </code></pre>
  
  <p>The WebDriver on the Android emulator runs the first two commands, but when it reaches <code>element = driver.find_element(:name, 'q')</code>, always fails with <code>EOFError: end of file reached</code>.</p>
  
  <p>I've found that the error occurs regardless of what follows the first <code>navigate</code>, so it doesn't seem to be an issue with the <code>find_element</code> method.</p>
  
  <p>For example, if I replace the code above with:</p>
  
  <pre><code>driver = Selenium::WebDriver.for :android
  driver.navigate.to "http://google.com"
  driver.navigate.to "http://stackoverflow.com"
  driver.quit
  </code></pre>
  
  <p>then I still get the same error on the second <code>navigate</code> command.</p>
  
  <p>I've tried experimenting with various timeouts, thinking that the issue is somehow related to connectivity, but the end result is always the same. The first navigation command appears to work properly, as the emulator will open up <code>google.com</code>, but nothing will happen afterwards.  </p>
  
  <p>Why am I getting this error? And how can I prevent it so that my tests can run?</p>