What are the advantages of TestNG over JUnit framework

0 votes
What are the advantages of TestNG over JUnit framework?
Jun 12, 2019 in Selenium by Kimberly
7,086 views

1 answer to this question.

0 votes

Hey Kimberly, TestNG has many advantages over JUnit testing framework:

  1. TestNG Annotations are easy to understand over JUnit.
  2. No constraints like declaring @BeforeClass and @AfterClass in TestNG, which are present in JUnit.
  3. As method name constraint is present in JUnit, such method name constraint is not present in TestNG and you can specify any test method names.
  4. TestNG enables you to group test cases easily which is not possible in JUnit.
  5. TestNG supports following three 3 additional setUp/tearDown level: @Before/AfterSuite, @Before/AfterTest and @Before/AfterGroup.
  6. TestNG do not require extend any class. 
  7. TestNG allows to execute test cases based on group which isn't possible in JUnit.
  8. Parallel execution of Selenium test cases is possible in TestNG.
answered Jun 12, 2019 by Abha
• 28,140 points

Related Questions In Selenium

0 votes
1 answer
0 votes
1 answer

What are the advantages of using Data-driven Test framework?

Hey Huma, some of the advantages of ...READ MORE

answered Jul 16, 2019 in Selenium by Abha
• 28,140 points
4,288 views
0 votes
2 answers

What is the role of TestNG & JUnit frameworks in Selenium?

TestNG and JUnit are test frameworks . it ...READ MORE

answered Sep 4, 2020 in Selenium by Sri
• 3,190 points
2,937 views
0 votes
1 answer
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
13,772 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
9,187 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,910 points
7,263 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
7,901 views
0 votes
1 answer

What are the advantages of Pytest framework over other test frameworks?

Hello Shanky, Pytest is one of the ...READ MORE

answered Aug 22, 2019 in Selenium by Abha
• 28,140 points
4,368 views
0 votes
1 answer

What are the benefits of using Junit testing framework?

Hi Prakhar, some of the benefits of ...READ MORE

answered Jun 12, 2019 in Selenium by Abha
• 28,140 points
4,629 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP