TestNG Eclipse Plugin With Examples

TestNG Eclipse plugin helps us in creating TestNG classes easily and executing them. Let’s see how to install “TestNG for Eclipse” plugin in Eclipse IDE.

TestNG Eclipse Plugin

  1. Open Eclipse and go to Help | Eclipse Marketplace. Then search for “TestNG”. You should get following result.
  2. In the next screen, accept the license agreement and click on Finish button.
  3. After installation is finished, Eclipse will ask you to restart so that TestNG Eclipse plugin is available to use. Click on “Restart Now” to restart Eclipse and start using the TestNG plugin.

TestNG for Eclipse Installation Verification

After Eclipse is restarted, go to New | Other. The wizard window will open up and you should see option to create a TestNG class.

If you get above option, then it means that TestNG Eclipse plugin has been installed successfully.

TestNG Eclipse Tutorial

You can go through TestNG Tutorial to learn how to create TestNG tests using TestNG for Eclipse plugin.

TestNG Eclipse Run Configuration

We can create TestNG classes run configuration so that we don’t have to find the test class and run it as TestNG test.

Let’s see how easily we can create an Eclipse TestNG Run Configuration.

Open the TestNG test class and go to Run As | Run Configurations.

In the configuration screen, provide a descriptive name for the configuration. Browse for the project and select the class as shown in the below image.

Click on “Apply” button to save the configuration. You can then click on “Run” button to run the configuration, which will run the TestNG test class.

You can go to Run | Run Configurations and select the predefined configuration to run the TestNG test class.

That’s all for a quick tutorial on using Eclipse TestNG plugin.

By admin

Leave a Reply

%d bloggers like this: