title: Run selenium tests on different browsers via TestNG
body: <p>Can anyone help me because I really don't get it:</p>
  
  <p>That is my TestNG file:</p>
  
  <pre><code>&lt;!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" &gt;
  &lt;suite name="GRID SAMPLE TEST" parallel="tests" verbose="3" thread-count="2"&gt;
      &lt;test name="GRID EXECUTION WITH  CHROME" parallel="classes" verbose="3" thread-count="2"&gt;
      &lt;parameter name ="browserType" value="chrome"/&gt;
          &lt;classes&gt;
              &lt;class name ="Tests"/&gt;
              &lt;class name ="Tests2"/&gt;
          &lt;/classes&gt;
      &lt;/test&gt;
      &lt;test name="GRID EXECUTION WITH  FF" parallel="classes" verbose="3" thread-count="2"&gt;
      &lt;parameter name ="browserType" value="firefox"/&gt;
          &lt;classes&gt;
              &lt;class name ="Tests"/&gt;
              &lt;class name ="Tests2"/&gt;
          &lt;/classes&gt;
      &lt;/test&gt;
  &lt;/suite&gt;
  </code></pre>
  
  <p>And that is my setUp method:</p>
  
  <pre><code>RegistrationPage rp;
  
      @BeforeClass
      @Parameters("browserType")
      public void setUp(String browserType) throws InterruptedException  {
          rp = new RegistrationPage();
  
          if (browserType.equalsIgnoreCase("firefox")) {
              Configuration.browser = "firefox";
          } else if (browserType.equalsIgnoreCase("chrome")){
              Configuration.browser = "chrome";
          }
          Configuration.baseUrl = "http://demoqa.com/registration/";
  
      }
  </code></pre>
  
  <p>I'm using Selenide which is a wrapper on Selenium but that's not the point.
  The point is that I want the same tests to be run on chrome (2 here) and firefox (to here).
  When I run them on debug then everything is okay and 2 tests are done on FF and another 2 on CHROME. But when I run them without debug just normally (right click on xml and run as testNG) then all my tests are done either on FF  only (4) or on CHROME only (4)!</p>
  
  <p>Can anyone please explain why? Did I do something wrong here?</p>