0
votes

I am introducing parallel execution into my testNG suite. When I set 'parallel' to 'tests', two browsers open and the first classes from my two tests begin simultaneously - this is what I would expect. When I set it to 'classes', I would expect both classes from my first test to begin simultaneously, however only one browser opens, the first method from the first class executes, then a new browser opens with the first method from the second class, and so on. Can anyone tell me what I am doing wrong?

Here is my xml file:

<suite name="FullRegressionSuite" parallel="classes" thread-count="2">
<listeners>
<listener class-name="reporting.CustomReporter"></listener>
</listeners>

  <test name="Test1">
  <parameter name ="Environment" value="Chrome_Hub"/>
    <classes>
      <class name="userManagement.LoginLogoutScript"/>
      <class name="carts.CartScript"/>
    </classes>
  </test>
  <test name="Test2">
  <parameter name ="Environment" value="Chrome_Hub"/>
    <classes>
      <class name="userManagement.AccountInformationScript"/>
      <class name="siteContent.ProductSearchAndFilterScript"/>
    </classes>
  </test>
1

1 Answers

0
votes

Can you please check if you are using static browser, if so, please avoid so to run test in parallel.

Please share where you initialising and launching browser.