title: Switching tab in Selenium IDE
body: <p>How can I focus on a newly opened window in Selenium IDE?</p>
  
  <p>I am clicking on a link and a new tab will open. However I am not able to shift the focus to the new window.</p>
  
  <p>I have tried <a href="https://stackoverflow.com/questions/11372921/selenium-ideopening-in-new-tab-and-shift-focus-to-new-tab-not-working">this other SO answer</a>, but it still doesn't work.</p>
  
  <p>Here is the code that I have tried:</p>
  
  <pre><code>&lt;tr&gt;
      &lt;td&gt;storeEval&lt;/td&gt;
      &lt;td&gt;selenium.getAllWindowTitles()[0]&lt;/td&gt;
      &lt;td&gt;windowName&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td&gt;getEval&lt;/td&gt;
      &lt;td&gt;this.doEcho(&amp;quot;array length: &amp;quot;+selenium.getAllWindowNames().length);this.doEcho(&amp;quot;Available window names: &amp;quot;+selenium.getAllWindowNames());this.doEcho(&amp;quot;Selecting window: &amp;quot;+storedVars['windowName']);this.doEcho(&amp;quot;Available window Titles: &amp;quot;+selenium.getAllWindowTitles());&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td&gt;echo&lt;/td&gt;
      &lt;td&gt;${windowName}&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td&gt;selectWindow&lt;/td&gt;
      &lt;td&gt;title=${windowName}&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>This code is using the current tab instead of the new tab and in echo it is printing the title of current tab and hence focussing again on current tab. When I use <code>1</code> instead of <code>0</code> in the array parameter (<code>selenium.getAllWindowTitles()[1]</code>) in the first line, it is printing <code>null</code>. </p>
  
  <p>I have also tried with names instead of titles but it still does not work.</p>