You can use Singleton and Factory pattern to solve the problem.
1. Create a separate class Browser
2. Create static property getInstance()
3. Call Browser. getInstance() where you need to get the driver instance
During first call at the first test getInstance() will create a new WebDriver instance and save it into static member “inst”. Static members can be shared across the tests.
Otherwise getInstance() will return old “inst” value. That makes the WebDriver persistent across the tests.
This is C# code, but I have tried to change it to look like Java code:
public class Browser
private static IWebDriver inst;
public static IWebDriver getInstance()
return (inst != null ) ? inst : new InternetExplorerDriver();