In this article you will learn how to verify TestNG is installed successfully or not, there are multiple ways to do so, we have produced couple of most popular and easy ways of verification
In case you have not yet installed TestNG plugin, we recommend you to follow “How to install TestNG plugin in eclipse latest version“
Easy ways to verify if TestNG is installed successfully
- Show view window
- Creating new class types
1. Verify TestNG is installed at show view window
- Navigate to menu Window > Show View > Other
- Expand Java folder in the Show View window
- You should see “TestNG” in the list
2. Verify if TestNG is installed successfully by creating a new class
- Right click on package explorer view in Eclipse IDE
- Create a new maven project ( assumption: maven plugin is already installed, i created with group id: com.tt.learning , artifact id: com.tt.learning )
- Once project is created, add testng maven dependency at pom.xml file.
- Now expand the com.tt.learning project in project explorer till src/test/java > com.tt.learning package folder appears.
- Right click on com.tt.learning pacckage folder and navigate to New > Other
- You should see a new Folder “TestNG” , you can expand to see if it contains “TestNG Class”
- Select TestNG class and click on next to create a new class
- Provide details as above and click finish
- You might see an error icon, that is because we need to provide maven dependency for TestNG
- Firstly, we need to get the maven dependency for TestNG and provide in pom.xml file of maven project
//here is a sample code
- Once you add above dependency in pom.xml and save the project, the error gets disappeared.
- Now right click on FirstClass.java file and select menu option “Run As > TestNG Test” from the context menu
- On completion on test execution, you can see the test results in console window.
Above are the 2 best ways to verify if TestNG plugin is installed successfully or not.
Founder of TestingTools.co, constantly shares knowledge on different test automation tools. Has experience in building proof of concepts, solutions, frameworks, platforms & implementation of test automation projects.
In pursuit of building a platform with inbuilt framework and reusable components for Oracle Cloud applications ( Oracle HCM, CX, SCM, Financials clouds, Salesforce and other cloud applications )
Major accomplishments in his career:
Product architect and development manager for test automation platforms
Oracle Flow Builder @ Oracle
CloudTestr @ Suneratech
2 times to oracle open world
More than 20 successful POCs ( Proof of concepts )
Designed pricing models.
Trained more than 50 members.
Built more than 100 re-usable functions.
Worked with tools: