How can Selenium close Chrome browser and open new One
<p>My scenario is to close the chrome browser and open a new one.</p>

<pre><code>public String openNewBrowserWindow() {
    this.log("Opening new Browser window...");
    String stringHandles;
    Set&lt;String&gt; previousWindows = driver.getWindowHandles();
    String previousHandle = driver.getWindowHandle();
    ((JavascriptExecutor)driver).executeScript("window.open();");
    Set&lt;String&gt; newWindows = driver.getWindowHandles();
    newWindows.removeAll(previousWindows);
    String newHandle = ((String)newWindows.toArray()[0]);
    stringHandles = previousHandle + ";" + newHandle;
    return stringHandles;
}
</code></pre>

<p>What I did is this:</p>

<pre><code>String handlesA = generic.openNewBrowserWindow();
String[] handleA = handlesA.split(";");
generic.closeBrowser();
generic.switchToWindow(handleA[1]);
</code></pre>

<p>This works on firefox but not in chrome. Do you guys have any suggestion?</p>