title: is it possible to use webdriver/Selenium to get current tab which user actually view
body: <p>I'm trying to use Selenium to check/monitor the tab that user using. But i found that the driver alway only monitor the first tab since browser open. </p>
  
  <p>I tried to use this </p>
  
  <pre><code>driver.current_window_handle
  </code></pre>
  
  <p>It shows the windows name but it is not exactly the tab user actually use. It is always the first tab unless i do  <code>driver.swith_to_window</code>
  Also, i tried to use </p>
  
  <pre><code>handles = driver.window_handles
  </code></pre>
  
  <p>then do this for each handle in handles </p>
  
  <pre><code>driver.swith_to_window(handle)
  </code></pre>
  
  <p>But this will interrupt user's operation as the browser will switch tab one by one.</p>
  
  <p>Is it possible to get the window handle, title or index of the current tab user actually view by webdriver or selenium?</p>
  
  <p>The scenario :</p>
  
  <ol>
  <li>python open browser</li>
  <li>user open tab 1, tab2, tab3 and access web site</li>
  <li>user views tab2</li>
  <li>selenium get the data from tab2</li>
  <li>user views tab1</li>
  <li>selenium get the data from tab1</li>
  <li>user views tab3</li>
  <li>selenium get the data from tab3  ...etc</li>
  </ol>
  
  <p>Currently i can only get the data from tab1. If user views tab2, then selenium do nothing unless i switch_to_window. But i don't know which one tab is user viewing.</p>