Search code examples
testngtestng-eclipse

Getting [TestNg] No test found error while running my @Test


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


Solution

  • 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.