February 2017
Intermediate to advanced
1023 pages
24h 11m
English
Q1. What is the difference between JUnit4 and TestNG?
JUnit and TestNG, both are unit testing frameworks, which look very similar in functionality. Both provide functionalities such as annotation supports, exception test, timeout test, ignore test, and suite test. Whereas, a group test and dependency test is only supported by TestNG. TestNG has the ability to dynamically generate the test data for parameterized test, whereas JUnit cannot. The following is a list of few annotations supported by TestNG and JUnit4:
|
Feature |
TestNG |
JUnit4 |
|---|---|---|
|
Test annotation |
|
|
|
Before the first test method in the current class |
|
|
|
After all the test methods in the current class |
|
|
Read now
Unlock full access