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.