title: How to reuse the exiting instance of webdriver for different classes
body: <p>I have gone through the existitng questions on this site, but unable to resolve 
  the following issue</p>
  
  <p>Tools:Junit,IntelliJ,Java Language</p>
  
  <p>//SetUp Class</p>
  
  <pre><code>public class SetUpTest {
  public static WebDriver driver;
  
      @BeforeClass
  public static void setUpTest() throws InterruptedException
  {
      driver=new FirefoxDriver();
  
      driver.get("http://www.ABC.co.uk");
      Thread.sleep(5000);
  
  }
  
  
  //Test1
  public class HomePageTest extends SetUpTest {
  
      @Test
      public void titleTest()
  
      {
          assertTrue(driver.getTitle().startsWith("ABC"));
  
  //Test2
   public void merchandisingTest() throws InterruptedException {
      @Test
      public void merchandisingTest()
      {
  
           driver.navigate().to("http://ABC.co.uk/deals");
   assertThat(driver.getPageSource(),containsString("deals"));
  </code></pre>
  
  <p>I have tried running the tests with @TestBefore but still two browser windows are opened
  one for Test1 and the other for Test2.I have also used @Suite.SuiteClasses
  but the problem is still there.</p>