You can see an example I wrote that proves that re-using browsers works just fine in WebDriver. Basically, as long as a browser window is instantiated from WebDriver, then you can use the getWindowHandles() to always grab onto it. If you have multiple windows open, just keep track of them using a List . You can identify windows that appear a certain way or contain certain information in them by using various WebDriver methods.
In other words, if a browser window was not opened by WebDriver, then WebDriver has no ability to hook onto it.
A rough example:
public static boolean selectWindow(WebDriver driver, String windowTitle){
//Search ALL currently available windows
for (String handle : driver.getWindowHandles()) {
String newWindowTitle = driver.switchTo().window(handle).getTitle();
if(newWindowTitle.equalsIgnoreCase(windowTitle))
//if it was found break out of the wait
return true;
}
return false;
}
In one project I did, I created a method that returns certain int status codes, depending on my arrangement of windows. If the status code is what I am expecting , then I know the next test can proceed without logging in again or without opening a new window.
Of course, if your test framework, such as Surefire or TestNG, forks threads by class, then you need one webdriver instance per class. If your test framework forks by method, then you'll need to pass the webdriver instance as an argument to the test method so the thread has access to it.