TestNG - Classes (and methods in it) not running as per the order mentioned in testng.xml

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

TestNG - Classes (and methods in it) not running as per the order mentioned in testng.xml

Sanchayan Paul
This post was updated on .
Hi,

My testng.xml looks like this -

<suite name="ALPHA SMOKE SCRIPTS" thread-count="5" verbose="10" preserve-order="true" preserver-order="classes" parallel="true">   
 <tests>       
  <test name="Smoke_Room_Type_Configuration_001" description="Verify  the  Managed Column in the Room Type  screen for ACTIVE Type as RMS Support Users" >
    <parameter name="scenario" value="SMOKE SCRIPTS" /> 
  <parameter name="testcase" value="Smoke_Room_Type_Configuration_001" />
  <parameter name="browser" value="firefox" /> 
  <parameter name="description" value="Verify the Managed Column in the Room Type screen for ACTIVE Type as RMS Support Users" />
    <classes preserve-order="true" preserver-order="classes">
      <class name="components.Common">
      <methods>
       <include name="login"/>
       <include name="propPINChange"/>
      </methods>
      </class>
      <class name="components.RoomTypeConfigComp">
      <methods>
       <include name="navigateToRoomClassViaDpDwn"/>
       <include name="verifyRoomTypesTable"/>
      </methods>
      </class> 
    </classes>
  </test> 
 </tests>       
</suite>

Problems
1. the methods in class - "RoomTypeConfigComp" are getting executed prior to the method in class - "Common", although I would like testng to adhere to the sequence mentioned above.

the preserve-order did not work for me.

Could you please help me in this regard. Thanks