title: Unable to switch to Window/popup in Firefox using selenium Webdriver in Python
body: <p>I have a URL <a href="http://travel.aol.co.uk/2016/03/23/best-hotels-for-families-mediterranean/" rel="nofollow">http://travel.aol.co.uk/2016/03/23/best-hotels-for-families-mediterranean/</a>   which has some Social sharing links such as Twitter , Facebook etc. When I click on them they lead to a new window. However, I am not able to perform operations on that window as I cannot switch to that window. Any help is appreciated. I tried switchTo methods but they don't work. Any help is appreciated.</p>
  
  <p>Following is the code</p>
  
  <pre><code>from selenium import webdriver
  from selenium.webdriver.common.keys import Keys
  
  driver = webdriver.Firefox()
  driver.get('http://travel.aol.co.uk/2016/03/23/best-hotels-for-families-     mediterranean/')
  window_before = driver.window_handles[0]
  linkElement = driver.find_element_by_class_name('share-icon-twitter')
  linkElement.click()
  window_after = driver.window_handles[1]
  driver.switch_to_window(window_after)
  print (driver.title)
  </code></pre>
  
  <p>When I print the title at the end, nothing shows up. But if I switch back to the old window and then print the title, correct title shows up.</p>
  
  <p>Thank you.</p>