login page class
public class LoginTest extends AppKeyFunctions{ public LoginTest() throws IOException {} @Test(groups= {"login"}) public void login() throws Exception { loginToApplication(); } } Add New Course class
public class AddNewCourse extends AppKeyFunctions{ public AddNewCourse() throws IOException {} @Test(groups= {"addCourse"}) public void addTheNewCourse() throws Exception { loginToApplication(); clickCourseInHomePage(); clickAddButton(); enterTheCourseDetails(title,description,duration,price,1); clickTheSaveButton(); this.verifyTheNewlyCreatedCourseDetailsInDatabase(); } } testng.xml file
<suite name="Suite"> <test name="all-test"> <groups> <run> <exclude name="login" /> <include name="addCourse"/> </run> </groups> <packages> <package name="com.oslos.testsuites" /> </packages> </test> </suite> I want to execute two different class files in package(com.oslos.testsuites) by using testng.xml but its showing NullPointerException when i execute the xml file.