0

I want to run a specific test class before running other tests in the same package using testng xml.

test_package
-------------
testclass1
testclass2
testclass3

I want testclass3 to run first.

<test name="Tests">
    <packages>
        <package name="tests.*"/>
    </packages>
</test>-->

There are multiple classes inside the package but i want selected test class to run ahead of all.

Edit: Selenium grid is being used. I want longer tests to run first so that other tests will run parallelly. Currently the longer test runs at last and other nodes are idle making the test duration longer

Success Shrestha
  • 433
  • 1
  • 4
  • 19
  • @Nexevis No, I want to run test class in specific order and i am using testng. – Success Shrestha Aug 22 '19 at 13:01
  • [Duplicate](https://stackoverflow.com/questions/12954779/how-to-run-the-test-classes-in-particular-order-using-seleniumwebdriverjava-wi) of this one then. Also whoever thought naming something "testng" is cruel, that so easy to misread as "testing". – Nexevis Aug 22 '19 at 13:03
  • Nexevis i've got too many classes and want to make use of package – Success Shrestha Aug 22 '19 at 13:08
  • FYI, if the success or failure of your tests depends on the order they are being run in, there's a large chance your tests aren't written properly. If, however, this is just to run fast tests before slow ones to avoid long debug cycles that's alright. – cameron1024 Aug 22 '19 at 13:26
  • @cameron1024 Selenium grid is being used. I want longer tests to run first so that other tests will run parallelly. Currently the longer test runs at last and other nodes are idle making the test duration longer. – Success Shrestha Aug 23 '19 at 03:36

0 Answers0