title: TestNG Parallel Testing, Opens two browser but runs all tests only in 1 browser
body: <p>Hi All I have an XML class</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;!DOCTYPE suite SYSTEM &quot;https://testng.org/testng-1.0.dtd&quot;&gt;
  &lt;suite name=&quot;Suite&quot; parallel=&quot;tests&quot; thread-count=&quot;2&quot;&gt;
      &lt;test name=&quot;Auto&quot;&gt;
          &lt;classes&gt;
              &lt;class name=&quot;Auto.....Name_of_class1......&quot;/&gt;
          &lt;/classes&gt;
      &lt;/test&gt;
  
      &lt;test name=&quot;Bad&quot;&gt;
          &lt;classes&gt;
              &lt;class name=&quot;Bad.....Name_of_class2......&quot;/&gt;
          &lt;/classes&gt;
      &lt;/test&gt;
       &lt;/suit&gt;
  </code></pre>
  <p>When I run this XML file, first it opens two Browsers ( Chrome ) then run both classes. But here is the confusing part for me</p>
  <p>When the browsers are open, out of these two browsers, only one browser will test cases.
  In my cases, I am running two classes parallel and each class has 2-3 test cases.
  but all of the test cases will run in one browser. 2nd browser just open and goes to the bases URL</p>
  <p>Also, I have tried changing parallel to &quot;class&quot;, &quot;True&quot; but no success.
  Results set are also very messy, Please take look at the screenshot</p>
  <p><a href="https://i.stack.imgur.com/eXPEI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eXPEI.png" alt="enter image description here" /></a></p>
  <p>Both classes calls :-</p>
  <pre><code>public static WebDriver initDriver() {
      
              if (driver == null) {
      
                  switch (prop.getProperty(&quot;browser&quot;)) {
      
                  case &quot;chrome&quot;:
                      WebDriverManager.chromedriver().setup();
                      driver = new ChromeDriver();
                      driver.manage().deleteAllCookies();
                      break;
      
                  case &quot;firefox&quot;:    
                      driver = new FirefoxDriver(fOptions);
    
                      break;
      
                  default:
                          System.out.println(&quot;Wrong driver was chosen!&quot;);
      
                  }
      
                  action = new Actions(driver);
                  driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
                  driver.manage().window().maximize();
              }
              return driver;
      
          }
  </code></pre>