Thursday 14 August 2014

Similarities and Difference Between Junit and TestNG Framework For WebDriver




Similarities Between JUnit and TestNG


1) We can create test suite in JUnit and TestNG both frameworks.

2) Timeout Test Is possible very easily in both the frameworks.

3) We can ignore specific test case execution from suite in both the frameworks.

4) It is possible to create expected exception test in both the frameworks.

5) Annotations - Few annotations are similar in both frameworks suite like @Test, @BeforeClass, @AfterClass. JUnit's Annotations @Before and @After are similar to TestNG's @BeforeMethod and @AfterMethod annotations.




Difference Between JUnit and TestNG


1) In TestNG, Parameterized test configuration is very easy while It is very hard to configure Parameterized test in JUnit.

2) TestNG support group test but it is not supported in JUnit.

3) TestNG has a feature to configure dependency test. Dependency test configuration is not possible in JUnit.

4) TestNG support @BeforeTest, @AfterTest, @BeforeSuite, @AfterSuite, @BeforeGroups, @AfterGroups which are not supported in JUnit.

5) Test prioritization, Parallel testing is possible in TestNG. It is not supported by JUnit.

No comments:

Post a Comment