title: Parallel run using testng
body: <p>I am trying to execute parallel run using testng.
  i am trying to run test 4 time parallel. But it runs only one time.</p>
  
  <p>testng.xml</p>
  
  <pre><code>&lt;suite name="My suite" parallel="methods" thread-count="4"&gt;
    &lt;test name="Default test" group-by-instances="true"&gt;
      &lt;classes&gt;
        &lt;class name="org.com.DemoClass"/&gt;
      &lt;/classes&gt;
    &lt;/test&gt; &lt;!-- Default test --&gt;  
  &lt;/suite&gt; &lt;!-- Default suite --&gt;
  </code></pre>
  
  <p>Demo class.</p>
  
  <pre><code>public class DemoClass {    
      @Test
      public void method1() throws InterruptedException {
          long id = Thread.currentThread().getId();
          System.out.println("Before test-method. Thread id is: " + id);
      }
  }
  </code></pre>
  
  <p>Please provide your valuable suggestion. </p>