Before we answer if TestNG is a part of selenium or not, let’s have a brief understanding of what actually TestNG.
TestNG stands for Test Next Generation. It is an automation testing framework and uses annotations. Annotations are lines of code that control how the method below it will execute. The greatest advantage of TestNG is that we can generate test reports and know the number of scripts passed, failed or skipped. Failed test cases can be run separately using TestNG. Along with it TestNG provides enables us with the ability to execute the test cases by reading the input file from any medium like excel and generate reports in a different medium.
The below figure explains a brief working idea of TestNG −
TestNG is not a testing tool; it is a testing framework that derives its existence from JUnit. It adds features that make testing easy, effortless and understandable with the help of customized test reports. Not only this, it makes testing even faster by enabling parallel execution.