TestNG is a testing framework inspired from JUnit and NUnit. It introduce some new functionalities to overcome the drawbacks in JUnit and making TestNG  more user-friendly.

TestNG is designed in such way that can support all types of tests, like unit tests, end-to-end tests..etc.


Now question comes in our mind is, How TestNG is more powerful then JUnit and what are the advantages of testng.Let us see....


Well defined Annotations:

  TestNG annotations are defined very clearly and easy to understand the usage of it.

Test-case Priority:   User can run the tests (or) test cases in order based on the business logic Priority.

Multiple Browsers Support:
    TestNG allows user to run same tests in multiple browsers like Firefox, Chrome ..so on.


Support Data driven testing:
    By using @DataProvider concept, user can run same test with multiple set of test data.

HTML Report:
   TestNG will provide understandable HTML report by default after completion of execution.
   User can integrate other third party reporting plugin like Extent report, ATU report..so on.

Failed test execution:
  Generally in test automation we see some false failures like loading/sync issues, to minimize the false failures and filter valid failures in testng there is possibility to re-execute the failed tests cases.

Dependent methods for application:
  TestNG support the dependence method execution. Ex: if one method is dependent on another.(Home page verification method is dependent on successfully login method)

Allows Grouping:
  TestNG supports Grouping, user can group tests based on features or modules or type of testing(Sanity or Regression).

Support for parameters:   There will scenario where user want to parameterize test data, lets say user wants to pass Browser name dynamically.(this basic example to give the some idea on the feature)



Categories: