title: Selenium switch to iframe not working in ruby
body: <p>I'm unable to find an element after switching to an iframe. I believe <code>driver.switch_to.frame("homeFrame")</code> is failing. I can locate other elements on the page that are not in the iframe, but I can't get anything inside the iframe.</p>
  
  <p>Here is my mock ruby:</p>
  
  <pre><code>require 'selenium-webdriver'
  
  begin
      driver = Selenium::WebDriver.for :firefox
      driver.manage.timeouts.implicit_wait = 10
      driver.navigate.to "file:///Users/$USER_NAME/Desktop/iframe/index.html"
      driver.switch_to.frame("homeFrame")
      link = driver.find_elements(:xpath, "/html/body/div[2]/div[3]/div/div/ul/li[5]/a")
      link.click
  end
  </code></pre>
  
  <p>I created a <a href="https://gist.github.com/spencerdcarlson/f29b9833608f6f2f2bbf" rel="nofollow">gist</a> with all the example code and the HTML I am working with.</p>
  
  <ol>
  <li>a-main.rb - mock example ruby script</li>
  <li>b-index.html - HTML that contains the iframe element</li>
  <li>c-homeFrame-iframe.html - HTML inside the iframe </li>
  </ol>
  
  <p>Here is the link to the gist <a href="https://gist.github.com/spencerdcarlson/f29b9833608f6f2f2bbf" rel="nofollow">https://gist.github.com/spencerdcarlson/f29b9833608f6f2f2bbf</a></p>