Getting error when running runner class | Selenium Forum
gautam Posted on 08/06/2021

Hi Ashish,

I am getting below error when running runner class. Please help


[TestNG] [ERROR] No test suite found. Nothing to run
Usage: <main class> [options] The XML suite files to run
Should MethodInvocation Listeners be run even for skipped methods
Default: true
Configuration failure policy (skip or continue)
Output directory
Number of threads to use when running data providers
Comma-separated list of group names to exclude
Comma-separated list of group names to be run
JUnit mode
Default: false
List of .class files or list of class names implementing ITestListener
or ISuiteListener
Comma separated of test methods
Default: []
List of .class files or list of class names implementing IMethodSelector
Mixed mode - autodetect the type of current test and run it with
appropriate runner
Default: false
List of .class files or list of class names implementing
Parallel mode (methods, tests or classes)
Possible Values: [tests, methods, classes, instances, none, true, false]
The port
Extended configuration for custom report listener
Default name of test suite, if not specified in suite definition file or
source code
Size of the thread pool to use to run suites
Default: 1
The list of test classes
A jar file containing the tests
Default name of test, if not specified in suitedefinition file or source
The list of test names to run
-testrunfactory, -testRunFactory
The factory used to create tests
Number of threads to use when running tests in parallel
The threadpool executor factory implementation that TestNG should use.
Whether to use the default listeners
Default: true
-log, -verbose
Level of verbosity
The full path to the xml file inside the jar file (only valid if
-testjar was specified)
Default: testng.xml


Ashish Replied on 09/06/2021

No test suite found. Nothing to run
Usage: <main class> [options] The XML suite files to run


this means you have not mentioned the suites to be executed..

May be file path is incorrect or some config is not correct

gautam Replied on 09/06/2021

Hi Ashish,

I have provided the suite name in the path. Below is the code:

public static void main(String[] args) {
// TODO Auto-generated method stub

TestNgRunner testNg = new TestNgRunner(1);
//we will create constructor for TestNgRunner which takes int value. It defines the number of test suites run parallely

testNg.createSuiteName("Portfolio_Suite", false);
testNg.addTestParam("action", "addstock");
List<String> includedMethods = new ArrayList<String>();
testNg.addTestClass("testRediff.PortFolioManagement", includedMethods);
includedMethods = new ArrayList<String>();
testNg.addTestClass("testRediff.StockManagement", includedMethods);


Ashish Replied on 11/06/2021

You have to add the test suite in TestNG

Have you done that in TestNgRunner 

gautam Replied on 11/06/2021

Hi Ashish,

Yes I have added in TestNgRunner as well:

public class TestNgRunner {

TestNG testng;
XmlSuite suite; //single suite
List<XmlSuite> allsuites; //list of all suites
XmlTest test; //single test case
List<XmlTest> allTestCase; //list of all test cases under a test suite
Map<String,String> testParam;
List<XmlClass> classes;// all the classes inside the test.


public TestNgRunner(int suiteThreadPool) { //constructor for TestNgRunner

allsuites = new ArrayList<XmlSuite>();//All suites and initialized the list. it is empty list
testng = new TestNG();//initialize testng
testng.setSuiteThreadPoolSize(suiteThreadPool);//How many parallel suites will run


public void createSuiteName(String suiteName, boolean parallelTest) {
// create suite Name.
//boolean : it will help to run the test in parallel. If true test will parallel if not will not run.
suite = new XmlSuite();

if(parallelTest) {

suite.setParallel(ParallelMode.TESTS);//(To run the suite parallely)

allsuites.add(suite);//Add suite in allsuites


Ashish Replied on 15/06/2021

Please zip and send me your project

gautam Replied on 15/06/2021

Hi Ashish,

I have attached the project.

Please have a look.


Gautam Prakash


gautam 9 hours ago

Hi Ashish,

Hope you are doing well.

Any update.



Related Posts