How to open a new tab in the existing Firefox browser using Selenium WebDriver (a.k.a. Selenium 2)?
Due to bug in https://bugs.chromium.org/p/chromedriver/issues/detail?id=1465 even though webdriver.switchTo actually does switch tabs, the focus is left on the first tab. You can confirm this by doing a driver.get after the switchWindow and see that the second tab actually go to the new URL and not the original tab.
Work around for now is what @yardening2 suggested. Use js to open an alert and then use webdriver to accept it.