title: how to switch driver control from the top window to iframe#mainFrame
body: <p>I am using firebug to inspect the xpath, one block of firebug shows the element your finding is in window or iframe and so on. I am facing similar kind of problem where it shows me 2 options 
  1: Top window
  2: iframe#mainframe
  now the problem is,when i inspect the element it shows in iframe#mainFrame, i tried switching the driver control from main window to iframe and detect the element using webdriver but it didn't work for me,I wrote the following set of code:</p>
  
  <pre><code>driver.switchTo().frame("mainFrame");
  driver.findElement(By.xpath("//div[@class='div_img']/img[@src='http://ser/themes/20/3/Flor/CF.jpg']")).click();
  </code></pre>
  
  <p>Note: when i checked the iframe in the html code,it doesn't contain another document inside it, It only contains id and other style and all and src tag.<br>
  Kindly suggest if there is some other way through which i can detect the element.  </p>