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.
Asked
Active
Viewed 4,014 times
0
-
You can let me know if you need any other details. – Bishnu Prasad Aug 11 '18 at 12:52
-
how you are running? right click - run as testng OR from tesng. xml OR from maven? – irfan Aug 11 '18 at 21:38
-
@qaautodev Its running as testng only, there is no .xml or maven project exist in the project directory. – Ishita Shah Aug 13 '18 at 04:42
2 Answers
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