TestNG Eclipse Plugin

Filed Under: TestNG

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.

    eclipse marketplace testng eclipse plugin

  2. Click on Install and next window will show TestNG features to install. Select all of them and click on Continue button.

    TestNG for Eclipse Features

  3. In the next screen, accept the license agreement and click on Finish button.

    TestNG Eclipse License agreement

  4. Eclipse will show the warning that you are installing software that contains unsigned content. Click on “Install Anway” button.

    TestNG for Eclipse warning

  5. 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.
    eclipse restart for 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.

eclipse create 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.

Eclipse TestNG Run Configuration

Click on the + button as shown in the below image.

New TestNG Run Configuration for Eclipse

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.

TestNG Eclipse Run Configuration Settings

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

close
Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages