public class SomeHooks {
private WebDriver driver;
@Before
public void startBrowser() {
driver = new FirefoxDriver();
}
@After
public void quitBrowser() {
driver.quit();
}
}
When using Spring or Guice (It does not affect picocontainer) the "driver" field will be null when accessed by the "quitBrowser" method executed as the After hook.