title: How to get Selenium and TestNG to open one browser to run tests in multiple classes
body: <p>I am using Selenium with TestNG to test a website. I have created tests using the Selenium IDE and exported them to TestNG with each test being a method in a class. Eg,</p>
  
  <p>For login tests there is a Login class which has methods testLogin(), testLogin2() etc
  For signup tests there is a Signup class has methods testSignup(), testSignup2(), etc</p>
  
  <p>I am using Ant to run the tests which works fine except that each class will open up a browser and then run its methods, eg, if I have five classes, then five browsers will open simultaneously and then run the tests.</p>
  
  <p>What I want is to get Ant/Selenium/TestNG to just open up one browser and then run all the tests (in the same browser) in all the classes that I have specified in testng.xml. Using the example above, I want one browser to open then run testLogin(), testLogin2(), testSignup(), testSignup2().
  If this cannot be achieved, then I want to open a browser, run all tests in a class then close the browser then open another browser then run the set of test methods in the next class.</p>
  
  <p>Any help appreciated. Thanks in advance.</p>