title: Parallel execution of tests using selenium grid testng
body: <p>I have 5 to 6 methods in a class and want to run methods in parallel on different nodes. I have grid 2 setup with 4 nodes in it.</p>
  
  <p>Find below my testng.xml</p>
  
  <pre><code>&lt;suite name="Test" parallel="methods"  thread-count="2"&gt;
  
      &lt;test name="Test1"&gt;
          &lt;classes&gt;
               &lt;class name="test.LoginTest"/&gt;
          &lt;/classes&gt;
      &lt;/test&gt;
  
  &lt;/suite&gt;
  </code></pre>
  
  <p>I have a test harness, which intilizes login, common and utils class</p>
  
  <pre><code>Public class TestHarness{
  public WebDriver driver = null;
  public DesiredCapabilities cap = null;
  
  public Login login;
  public Common common;
      public void initilize(){
          cap = DesiredCapabilities.firefox();
                  cap.setBrowserName("firefox");
                  cap.setPlatform(Platform.ANY);
          driver = new RemoteWebDriver(new URL(CONFIG.getProperty("hub")),cap);
  
          common = new Common(driver);
          login = new Login(driver);
          utils = new Utils(driver);
  
      }
  
  }
  </code></pre>
  
  <p>In my test class I extend the test harness and in @BeforeMethod I call the intilize method </p>
  
  <pre><code>public class LoginTest extends TestHarness{
  
      @BeforeMethod
      public void startTest() {
  
          initilize();
          login.loginAsAdmin();
      }
  
      @Test
      public void testLoginWithCorrectPassword(){
          common.goToAdminSettings();
      }
  
      @Test
      public void testLoginwithInCorrectPassword(){
          utils.getMessage();
      }
  }
  </code></pre>
  
  <p>If I run the testing, I see the following problem</p>
  
  <p>Two browsers are opening one in each node but only one browser launches the application and the other doesn't.</p>
  
  <p>Let me know if I am missing anything?</p>
  
  <p>Thank You</p>