Sunday, November 3, 2013

What is TestNG ?

TestNG, where NG stands for "next generation" is a test automation framework inspired by JUnit (in Java) and NUnit (in C#). It can be used for unit, functional, integration, and end-to-end testing. TestNG has gained a lot of popularity within a short time and is one of the most widely used testing frameworks among Java developers. It mainly uses Java annotations to configure and write test methods.
TestNG was developed by Cedric Beust. He developed it to overcome a deficiency in JUnit. A few of the features that TestNG has over JUnit 4 are:
·         Extra Before and After annotations such as Before/After Suite and Before/After Group
·         Dependency test
·         Grouping of test methods
·         Multithreaded execution
·         In-built reporting framework
So, let's get familiarized with TestNG. As I mentioned earlier, TestNG is a testing framework. It is written in Java and can be used with Java as well as with Java-related languages such as Groovy. In TestNG, suites and tests are configured or described mainly through XML files. By default, the name of the file is testng.xml, but we can give it any other name if we want to.
TestNG allows users to do test configuration through XML files and allows them to include (or exclude) respective packages, classes, and methods in their test suite. It also allows users to group test methods into particular named groups and to include or exclude them as part of the test execution.
Parameterization of test methods is very easy using TestNG and it also provides an easy method of creating data-driven tests.

TestNG exposes its API which makes it easy to add custom functionalities or extensions, if required.


No comments:

Post a Comment