Before you install TestNG in Eclipse, make sure you’ve set up the necessary
software and tools. Here’s what you need:
🔧 Pre-Requisites (What You Need First)
- Java JDK Installed
- Download and install the latest Java JDK.
- Make sure the JAVA\_HOME environment variable is set correctly.
- Eclipse IDE Installed
- Install the latest version of Eclipse IDE for Java Developers from the official Eclipse website.
- Internet Connection
- An active internet connection is needed during the installation of the TestNG plugin.
🚀 How to Install TestNG Plugin in Eclipse
By default, Eclipse does not come with built-in support for
TestNG. You’ll need to install it manually using one of the two methods
below:
🛒 Method 1: Install via Eclipse Marketplace (Recommended)
1. Open Eclipse IDE
2. Click on the top menu: Help → Eclipse Marketplace...
3. In the search box, type TestNG and press Enter.
4. Click the Install button next to the TestNG plugin.
5. When the confirmation window appears, click Confirm.
6. Accept the license agreement by selecting
"I accept the terms..." and click Finish.
7. During installation, if a Trust dialog appears, click
Select All → Trust Selected.
8. Once the installation completes, Eclipse may prompt you to
restart —go ahead and restart it.
✅ After restart, you’ll be able to create TestNG classes easily in
Eclipse.
🧰 Method 2: Install via "Install New Software…" (Manual Method)
1. In Eclipse, go to Help → Install New Software...
2. Click Add...
3. In the dialog box:
Name: Type anything (e.g.,
`TestNG`)
Location: Paste this URL
```
https://testng.org/testng-eclipse-update-site
```
* Then click Add
4. Select the checkbox for TestNG from the list.
5. Click Next, accept all terms and conditions, and then click
Finish.
6. Approve any security prompts and complete the installation.
7. Restart Eclipse when prompted.
🎉 You're Done!
After installation, you can:
* Create new TestNG classes
* Run tests using the TestNG framework
* View results in the TestNG results tab