Enter your email address:
My xml script is executing methods in alphabetical order, I wanted to execute my tests in my own order
Can anyone suggest How to run test methods in specific order in TestNG xml?
Aruna, try using the priority attribute to your @Test annotation like this. @Test(priority=1) . Choose the priority in an order starting from 1 and test will be executed from 1 2 3 to the max number.
Virender, This really worked..
If you want to run testng.xml based on your preference then add below code into testng.xml
<test name="Regression1" preserve-order="false">
Refer below tutorial for more details
I have added the above suggested line in my xml, but it doesn’t worked .