1

PhFramework.pizzas.bbqMeatFeast.cheesyBites.LargeTest should execute all tests before proceeding to PhFramework.pizzas.bbqMeatFeast.classicCrust.LargeTest

TestNG seems to be executing the first @Test within all the classes, if i execute only one Test Class at a time it works fine.

enter image description here

testng.xml code: the following will fail, but if i remove one of the classes it works. enter image description here

Please can somebody advice what could cause this issue?

thanks for your help

Krishnan Mahadevan
  • 14,121
  • 6
  • 34
  • 66
Gbru
  • 1,065
  • 3
  • 24
  • 56

3 Answers3

2

On line no 4 of your testng.xml, it should be:

<suite name="Suite" parallel="tests" preserve-order="true">
spdl83
  • 326
  • 3
  • 5
  • still the same issue persists, even when adding a thread count of 1 both tests are getting executed at the same time. – Gbru Nov 15 '16 at 09:19
  • For example: class1 should execute then class2, Instead class1 and class2 are executing in parallel, the testng.xml file that i have setup works on my other machine; maybe something external could be triggering the issue. – Gbru Nov 15 '16 at 09:21
0

preserver-order="true" should be in the <test> tag, not the <suite> tag

nofacade
  • 96
  • 2
  • 4
  • thanks @nofacade but even applying the above code still fails, it seems to execute both of the test classes at the same time? but parallel="false" and even when i add a thread count of 1 – Gbru Nov 14 '16 at 15:44
  • hmm, are you sure you're running the correct testng.xml file? By default testng executes tests in order in the xml file. – nofacade Nov 14 '16 at 15:53
  • Yes @nofacade, its strange, the testng.xml works on my other machine which has the exact same setup,its as it fails to execute the test cases correctly when one+ test classes are executed – Gbru Nov 14 '16 at 16:01
0

Notice your packages' names, you have different packages, maybe you have same classes names on two packages?

Moshisho
  • 2,781
  • 1
  • 23
  • 39
  • the class names are different one is 'Medium' and the other one is 'Large' so its pointing to the correct classes, i just cant seem to stop them from executing in order and not at the same time :/ – Gbru Nov 14 '16 at 16:10
  • The class names are different but notice 'PhFramework.pizzas.bbqMeatFeast.classicCrust' and 'PhFramework.Margarita.pam' – Moshisho Nov 14 '16 at 16:18
  • yes @Moshisho that is correct, both are stored within different packages but this shouldnt impact the execution phase, even using a wildcard which will execute all classes and packages still fails and this also works on my other system which is using the exact same project – Gbru Nov 14 '16 at 16:25
  • If you try putting in the xml the package name that worked e.g. bbq... It still fails the same? – Moshisho Nov 14 '16 at 16:32
  • yes it still does the same thing either execute both classes at the same time or execute only the first @Test of each class – Gbru Nov 14 '16 at 16:34
  • @Phil_P85 - We would need a bit of a debug data to figure out more. So can you please add verbose="5" to your suite xml file and then run it once again and share the debug logs here ? [ Maybe you can just update your question itself with the link to the debug logs ] You can perhaps post the debug logs on gist.github.com and share a link in your question. – Krishnan Mahadevan Nov 16 '16 at 04:06