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 )
- 100 demos
- Designed pricing models.
- Trained more than 50 members.
- Built more than 100 re-usable functions.
Worked with tools:
Hello Srinivas , thanks for guidence ,
After getting intalled successfully i am getting error
Well i might have to see what is the issue you are facing or share any error log
I have a question but not sure if you can help me.
I just downloaded the latest IntelliJ with Maven installed. My IntelliJ is not recognizing TestNG annotations.
Do I have to download some extra plugin(s) or files and perform additional setups?
I’m asking because TestNG is supposed to come “bundled” with IntelliJ according to IntelliJ itself and according to the testng.org website…
So I was assuming (perhaps wrongly) that it would work straight out-of-the-box. Thank you for any help. Happy Makar Sankranti day!
Sorry I have not worked in intelliJ , maybe you have to look for other places
After following the process issue doesnot resolve. Is their any alternative? Number of errors increased.
Need to see what kind of errors you are getting also, there might be a new string to get TestNG also nowadays with the latest eclipse we are able to install from marketplace itself