Run TestNG class in main method

public static void main(String[] args) {
TestListenerAdapter testListenerAdapter = new TestListenerAdapter();
TestNG testng = new TestNG();
testng.setTestClasses(new Class[] { test.class });
testng.addListener(testListenerAdapter); 
testng.run(); 
}

Leave a Reply

Your email address will not be published. Required fields are marked *