Technologies - TestNG Framework - What & Why?
What is TestNG
Its a New Generation Unit Testing
framework, that is influenced by both JUnit and NUnit, but has more
powerful features and is easier to use. It is designed with a good set of
capabilities that simplify testing requirements ranging from functional,
regression, end-to-end, and more
Why testNG:
1. Support for annotations -
Annotations in TestNG are lines of code that can control how the method below
them will be executed. Annotations can use parameters just like the usual Java
methods.
2. Support for parameterization - Static data using @Parameters
3. Support for Data Driven Testing using Data providers - Dynamic data
4. Enables user to set execution priorities &
groups the test methods
5. Readily supports integration with various tools and plug-ins like build
tools (Ant, Maven etc.),
6. Facilitates user with effective means of Report Generation using
ReportNG. WebDriver has no native mechanism for generating reports,
So TestNG can generate reports based on our Selenium test results.
7. The ability to run tests in parallel is available in TestNG but not in
JUnit, so it is the more preferred framework of testers using Selenium Grid
8. Uncaught exceptions are automatically handled
by TestNG without terminating the test prematurely. These exceptions are
reported as failed steps in the report
9. There is no more need for a static main method in our tests. The sequence of
actions is regulated by easy-to-understand annotations that do not require
methods to be static.
10. TestNG assertions – Hard & Soft asserts
-The Assert class is used to conduct verification operations in TestNG
Click on the following link to learn How to integrate TestNG with Maven
Click on the following link to learn How to integrate TestNG with ANT
Comments
Post a Comment