Make Selenium Easy

TestNG Jar & TestNG Plugin – Both Are Two Different Things

Let’s start with some questions :-

I have installed TestNG but I am not getting TestNG annotation. Why?

I have added TestNG jar but not getting an option to run test as a TestNG test in Eclipse. Why?

You must have heard or faced the above questions. The reason behind these is that You may not get the “What and Why” of TestNG Jar and TestNG plugin.”.

TestNG Jar :-

TestNG jar is a Test framework which allows you to do a lot of things like creating tests, creating configuration methods, running tests, parallel execution, data driven testing , reporting and many more. To use these features you MUST need to add TestNG dependency in Maven or Gradle project or download JAR and add to project build path. After that only you will be able to use different annotation provided by TestNG.

TestNG Plugin :-

When you create some test, by default you do not get option to run test as a TestNG test in Eclipse as shown below:-

To run the test as TestNG test, you need TestNG Plugin. You can install TestNG plugin from Eclipse Market place or Install New Software in Eclipse.

Note :- You do not need TestNG plugin in IntelliJ as TestNG is bundled in IntelliJ IDEA.

You can find step by step tutorial to install TestNG plugin in eclipse here.

If you have any doubt, feel free to comment below.
If you like my posts, please like, comment, share and subscribe.
#ThanksForReading
#HappyLearning

You can find all Selenium related post here.
You can find all API manual and automation related posts here.
You can find frequently asked Java Programs here.

Table of Contents

Author: Amod Mahajan

My name is Amod Mahajan and I am an IT employee with 6+ years of experience in Software testing and staying in Bengaluru. My area of interest is Automation testing. I started from basics and went through so many selenium tutorials. Thanks to Mukesh Otwani as his tutorials are easy and cover basics to advance. I have habit of exploring concepts by deep diving. I used to make notes. I thought of sharing my knowledge through posts and now I am here. #KeepLearning #ShareLearning

4 thoughts on “TestNG Jar & TestNG Plugin – Both Are Two Different Things

  1. hi Amod. I am a little confused here.
    first i installed testng plugin in eclipse and i was able to add TestNG annotations and run TestNG class. Also, i saw TestNG.jar file in TestNG folder created. however, when tried creating a xml file using Convert to TestNG class, no xml is created.

    so i have two queries:
    1) if we install testng from plugin from eclipse marketplace, is there a need to install testNG jar file separately ( as i can see jar file in TestNG library foler)
    2) what can i do to create testng.xml file?

    Thanks,
    Sapna

    1. Hi, you would have TestNG library earlier that’s you would be getting that. But both are two different thinhs.

  2. Hi Amod,

    That was a nice tip. Addition to this if an organization has blocked software installing from market place. There is a work around wherein we can put the testng.jar file in the dropins folder found inside the eclipse folder.
    Should close and reopen the eclipse and you can now find the option RunAs Testng.

    1. You are making same mistake again. You don’t download TestNG jar from Market place. Its TestNG plugin for eclipse. If downloading is blocked from market place, you can download from url and place in dropin folder.

Leave a Reply

Please wait...

Subscribe to new posts to become automation expert

Want to be notified when my new post is published? Get my posts in your inbox.

TestNG Jar & TestNG Plugin – Both Are Two Different Things

by Amod Mahajan time to read: 1 min
4
%d bloggers like this: