Introduction to TestNG testing framework

TestNG is a testing framework inspired from JUnit and NUnit but introducing some new functionalities that make it more powerful and easier to use, such as:

  • Annotations.
  • Run your tests in arbitrarily big thread pools with various policies available (all methods in their own thread, one thread per test class, etc…).
  • Test that your code is multithread safe.
  • Flexible test configuration.
  • Support for data-driven testing (with @DataProvider).
  • Support for parameters.
  • Powerful execution model (no more TestSuite).
  • Supported by a variety of tools and plug-ins (Eclipse, IDEA, Maven, etc…).
  • Embeds BeanShell for further flexibility.
  • Default JDK functions for runtime and logging (no dependencies).
  • Dependent methods for application server testing.

TestNG is designed to cover all categories of tests:  unit, functional, end-to-end, integration, etc….

Initially it is developed for unit testing but now we use if for all level testing.

Advantage of TestNG

  1. Annotations are easy to use
  2. Test cases can be grouped and priories easily
  3. Executes multiple program/classes using XML(TestNG Suite: it is an XML file)
  4. Parallel testing
  5. Generate test reports

Next
TestNG
Home Page

Leave a comment

Design a site like this with WordPress.com
Get started