0

While running my @Test using TestNg, i am getting "[TestNG] No tests found. Nothing was run Usage: [options] The XML suite files to run" error message. Could anyone please help me on the same. Please find the attach screen shot for all the details.

enter image description here

Bishnu Prasad
  • 87
  • 4
  • 13

2 Answers2

1

Move you test to separate class e.g. StringSplitterTest and it should start work as your expected.

It is a bad practice to put test in the same class with objects under tests. You are getting error on test class initialization because TestNG does not know what arguments to put in your constructor.

RocketRaccoon
  • 2,559
  • 1
  • 21
  • 30
0
  • You have Run Separator class as according to your shared Screenshot. Where @Test annotation is not defined in that class and TestNG through this exception.

  • You need to run StringSplitterTest class as TestNG, So it will executes that class.

  • If you want to execute Separator class first, You need to define @Test class under that.

  • If there are methods you wants to call it in another class, call it from the class in which @Test is defined.

Ishita Shah
  • 3,955
  • 2
  • 27
  • 51