What is JUnit and what are the features of it

0 votes
Jun 11, 2019 in Selenium by Irfaan
12,425 views

1 answer to this question.

0 votes

Hey Irfaan, JUnit is an open source unit testing tool and used to test small/large units of code. To run the JUnit test you don’t have to create a class object or define the main method. Junit provides assertion library which is used to evaluate the test result. Annotations of JUnit are used to run the test method. JUnit is also used to run the Automation suite having multiple test cases. 

It is used by developers to implement unit testing in Java, and accelerate programming speed and increase the quality of code. JUnit test framework provides the following important features:

  • Fixtures: Fixed state of a set of objects used as a baseline for running tests. The purpose of a test fixture is to ensure that there is a well-known and fixed environment in which tests are run so that results are repeatable.
  • Test suites: Bundles a few unit test cases and runs them together. Both @RunWith and @Suite annotation are used to run the suite test. 
  • Test runners: Test runner is used for executing the test cases.
  • JUnit classes: JUnit classes are important classes, used in writing and testing JUnits. Some of the important classes are Assert, TestCase, TestResult.
    answered Jun 12, 2019 by Anvi
    • 14,150 points

    Related Questions In Selenium

    0 votes
    1 answer

    What is Xpath and what are the types of it in Selenium Webdriver?

    Hi Piyush, XPath is defined as XML path. It is ...READ MORE

    answered May 9, 2019 in Selenium by Pratibha
    • 3,690 points
    5,353 views
    0 votes
    1 answer

    What is a Selenium framework and what are the benefits of it?

    Hi Disha, Selenium framework is a code structure ...READ MORE

    answered May 13, 2019 in Selenium by Abha
    • 28,140 points
    1,102 views
    0 votes
    1 answer

    What are locators in Selenium and what are the different types of it?

    Hi Divya, in Selenium Locators define an ...READ MORE

    answered May 7, 2019 in Selenium by Abha
    • 28,140 points
    2,639 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,567 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,084 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,178 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,840 views
    0 votes
    2 answers

    What is PhantomJS and what is the usage of it?

    @Ojaswini, Phantomjs is used for automating webpage ...READ MORE

    answered Aug 1, 2019 in Selenium by Abha
    • 28,140 points
    2,132 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