-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Execution order changed from version 6.0.1 to 6.8 #288
Comments
Here is the code: https://github.com/ajay516/ajay516-testng-execution-order |
Yeah, i can reproduce that. Probably workaround: use testng.xml with preserve-order="true". After some investigations i have found that "dependOnMethods" matter. Without dependency all works fine. Looks like TestNG incorrectly reorders test methods to run. Simplified code you can find at VladRassokhin/testng-execution-order |
Is there a workaround (except removing all dependsOnMethods)? |
any clue of the root cause? action plan? The reason (at least for my use case:selenium ui testing) to choose testng over junit is tests dependencies. order all tests in xml is not feasible for large project with hundreds, thousands tests. |
If you want precise ordering, you should use dependsOnGroups, not XML (which was never designed to specify ordering). |
dependsOnGroups does not work, at least not as my understanding. given one base class, and two sub classes, depended group in base class the expected output:
actual output:
suite.xml
tell me, if I understand the documentation in a wrong way. Appreciate, if anyone can tell me how to properly use test dependencies in testng. |
The ordering looks correct to me. What you seem to be wanting is atomicity (invoking groups of methods together)? |
how could it be right? per http://testng.org/doc/documentation-main.html#testng-xml my understand is, TestNG executes tests in the order found in the XML file, within each test, annotations (dependsOnGroup, dependsOnMethods) will decide the order. so, I have SubClassA before SubClassB in xml, I expect TestNG execute SubClassA before doing anything about SubClassB. no? |
The depend annotations override anything that is found in the XML. Either you use preserve-order=true in your XML file or you define dependencies in Java. |
Thanks for the clarification. One more question, when you say "override anything that is found in the XML", that also apply to "group-by-instances" / "order-by-instances"? There is no way to archive it by using annotations? btw, should it be "group-by_instances" or "order-by-instances"? Neither of them exists in http://testng.org/testng-1.0.dtd from http://testng.org/doc/documentation-main.html
|
Hello, I am using the latest version of TestNG (6.8.8) and I don't know how to solve an issue that I have. I would like the tests from the reports to be in the order that they have executed. Can you please help me in solving this issue? Thank you |
Hello, I've created a pull request that, I believe, fixes this issue: |
I just upgraded my project (from 6.0.1 to 6.8) and found that the order of execution of tests are changed. In version of 6.0.1, the order of execution is:
In version 6.8, the order becomes:
Here are my observations:
Here is my execution environment:
The text was updated successfully, but these errors were encountered: