// By default, 1 window is created when Driver is launched
WebDriver d = getDriver();
assertEquals(1, d.getWindowHandles().size());
// Check the number of windows
d.navigate().to("about:blank");
assertEquals(1, d.getWindowHandles().size());
// Create a new window
((JavascriptExecutor) d).executeScript("window.open('http://www.google.com','google');");
assertEquals(2, d.getWindowHandles().size());