1

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.

1 Answer 1

1

Try creating and give your classname inside it with package name.

eg:-

 <class name="packagename.classname"/> </classes> 

 <class name="packagename.classnameTwo"/> </classes> 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.