When in TestNG, the @Test methods execute randomly and in what case they execute in alphabetical order? I have not using any priority tags or grouping tags either as parameters or as xml tags.

https://www.guru99.com/test-case-priority-testng.html In the above tutorial "Demo of TestNG code without Priority" it should give output as the below when considered as alphabetical order. FaceBookPageTitleVerification() launchGoogle() openBrowser() peformSeachAndClick1stLink()

Again in the example in the same page "Demo of TestNG code without Priority in Alphabetical Order" the output is in alphabetical order. Why not it is executed in alphabetical order in first case?


  • 2
    Does it matter? Tests should be independent anyway, so if you execute them in any order, they should still bring you the same information.
    – pavelsaman
    May 19 '21 at 12:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.