How to resolve TestNG run option not shown in Eclipse?
Some users might face issue with TestNG run option not available under Run configurations due to below possibilities.
TestNG plugin is not installed: To use TestNG in Eclipse, you need to have the TestNG plugin installed. If it is not installed, you can install it from the Eclipse marketplace.
TestNG dependency to POM.xml file is missing.
Incorrect build path: Ensure that the TestNG library is included in your project build path. You can add the library to the build path by right-clicking on your project and selecting βBuild Pathβ and then βConfigure Build Path.β
Make sure project is selected with minimum Java version 1.8
The project should have @Test Annotation with or without main() class.
Follow below steps if TestNG option is not visible under Window->Show view->Other->TestNG, even after plugin installation and dependency are added.
- Helpβ>Install new softwareβ>already installed β>TestNG (All)β> Uninstall β> restart now (Eclipse will restart)
- After restart again Helpβ>Install new software β> Clicks on βAddβ β> Name TESTNG URL βΒ https://testng.org/testng-eclipse-update-site/7.4.0/Β β> Ok
- After install restart now Eclipse
- Run as TestNG option is available