difference between testng and junit

-Annotations;
JUnit  --> @Test, @BeforeClass, @AfterClass, @Before, @After, @Ignore
TestNG --> @Test, @BeforeTest, @BeforeClass, @BeforeSuite, @BeforeMethod, 
		   @AfterTest, @AfterClass, @AfterSuite, @AfterMethod
           
-Both are testing framework to help us running automation scripts.
-TestNG provide HTML report.
-TestNG has @DataProvider annotation same as Cucumber Scenario Outline for DDT
-Both We can do parallel testing, but in different way. In TestNG we use XML
runner. In JUnit we use Maven Surefire Plugins.
-TestNG support group test but JUNit doesn't support.
-TestNG and JUnit both of them have parameterized testing but TestNG 
parameterizedd test configuration is very easy to configure. There are two ways
to achieve it in TestNG;
@Parameters and TestNG xml file
@DataProvider

4.67
3
Kake_Fisk 115 points

                                    -Annotations;
JUnit  --> @Test, @BeforeClass, @AfterClass, @Before, @After, @Ignore
TestNG --> @Test, @BeforeTest, @BeforeClass, @BeforeSuite, @BeforeMethod, 
		   @AfterTest, @AfterClass, @AfterSuite, @AfterMethod
           
-Both are testing framework to help us running automation scripts.
-TestNG provide HTML report.
-TestNG has @DataProvider annotation same as Cucumber Scenario Outline for DDT
-Both We can do parallel testing, but in different way. In TestNG we use XML
runner. In JUnit we use Maven Surefire Plugins.
-TestNG support group test but JUNit doesn't support.
-TestNG and JUnit both of them have parameterized testing but TestNG 
parameterizedd test configuration is very easy to configure. There are two ways
to achieve it in TestNG;
@Parameters and TestNG xml file
@DataProvider

4.67 (3 Votes)
0
Are there any code examples left?
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source