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

0 votes
I am self learning Selenium and know quite a bit about creation of Classes, Interfaces, Objects, Inheritance, Arrays, Loops in Java. And aAs far as Selenium is concerned, I'm able to test web pages by writing the code in Java by locating elements using Firebug/Firepath tool. But I always come across these terms TestNG and JUnit..What do they do? What are they? Are they related to selenium? And is it compulsary to learn them?
Apr 18, 2018 in Selenium by kappa3010
• 2,010 points
147 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes
Well TestNG and JUnit are test frameworks which compliment the working of WebDriver. Selenium WebDriver has limitation wrt test cases and test reports.
1. Test cases cannot be managed very easily. As in, it is a little complex to verify the pass/ fail criteria.
2. The reports that get generated at the end of the test is not structured.

To overcome these 2 main challenges, we use TestNG/ JUnit. Especially with TestNG, we can choose to run any number of test cases and classes by controlling it from the testng.xml file. It is very simple. More over, the assertion of a test case is also fairly easy and we can figure out which test cases passed and which failed from the detailed test reports.
answered Apr 18, 2018 by king_kenny
• 3,590 points

Related Questions In Selenium

0 votes
1 answer

what is the need of xpath when you have attributes like id ,class,name in selenium?

It is not necessary that every element ...READ MORE

answered Jun 1, 2018 in Selenium by Vinita
• 220 points
61 views
0 votes
1 answer

What is the use of grouping in testNG?

Grouping is the method used to separate ...READ MORE

answered Dec 26, 2018 in Selenium by Trisha
49 views
0 votes
1 answer
0 votes
1 answer

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,050 points
131 views
0 votes
1 answer

Diff between WebDriver listeners and TestNG listeners?

This is not a very important concept ...READ MORE

answered Apr 13, 2018 in Selenium by king_kenny
• 3,590 points
1,236 views
0 votes
1 answer
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,130 points
519 views
0 votes
1 answer

What is the difference between thoughtworks.selenium and openqa.selenium selenium?

thoughtworks.selenium is the original Selenium (aka Selenium 1, ...READ MORE

answered Apr 13, 2018 in Selenium by king_kenny
• 3,590 points
103 views
0 votes
1 answer

What is difference the between Selenium and Celerity?

If you are talking about speed, use Celerity. If ...READ MORE

answered Apr 20, 2018 in Selenium by king_kenny
• 3,590 points
42 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.