Skip to main content

Introduction of TestNG framework - Advantages of TestNG over Junit framework



TestNG Framework Training in Hyderabad

 Introduction of TestNG framework - Advantages of TestNG over Junit framework
In Selenium Web Driver training run Selenium scripts using JUnit framework. Until now we have executed seleniumtests but we have not generated reports in JUnit. We are introducing the powerful new testing framework called TestNG. The TestNG framework means Next Generation testing framework. So we are seeing all next generation features available in TestNG. I will talk about advantages of TestNG Framework TrainingIn Hyderabad over Junit.
TestNG Framework Training In Hyderabad
TestNG is popular JUnit framework used for the Java programming language. The TestNG framework introduced to overcome the limitations of JUnit framework. Most of the automation users are using this framework. Its advantages & more supported features. Until we have executed selenium test script but not even generated test reports. So using this TestNG framework learns to generate test reports.
Features of TestNG Framework:
TestNG supports many powerful features & it is easy to use. Let’s see what all new features support in the new testing framework
  • Support for parameters.
  • Supports dependent methods testing.
  • Test configuration flexible.
  • Supports powerful execution model.
  • Embeds BeanShell for further flexibility.
  • TestNG has a simple way of handling parameterized tests with the data-provider concept.
  • For the same test class TestNG support for many instances.
  • Extendibility of using different Tools and plug-ins like Eclipse, Maven, IDEA.
  • Default JDK functions for runtime and logging.
  • Annotations @BeforeSuite, @AfterSuite, @BeforeClass, @AfterClass, @BeforeTest, @AfterTest, @BeforeGroups, @AfterGroups, @BeforeMethod, @AfterMethod, @DataProvider, @Factory, @Listeners, @Parameters, @Test.


    TestNG supports annotations are very helpful to guide test case executions. JUnit TestNG annotations proceeded by the ‘@’ symbol. It permits parallel execution of test cases. We can also skip the test cases while executing test cases.


    TestNG designed to cover all types testing categories. Like Unit, Functional testing, Integration testing, End-to-end. The TestNG framework generates test reports in both HTML and XML formats. Using ANT with TestNG, we can generate primitive Test reports as well.
Advantages of TestNG over Junit:

1. TestNG Annotations are easy to understand over JUnit.
2. In TestNG there is no constraint declare @BeforeClass and @AfterClass. This is present in JUnit.
3. As method name constraint is present in JUnit. The method name constraint is not present in TestNG method names.
 4. In TestNG enable you to the grouping of test cases which is not possible in JUnit.
5. TestNG supports following three 3 extra setup/teardown level:

@Before/After Suite, @Before/After Test and @Before/After Group.

6. TestNG do not need to extend any class.
7. TestNG dependent test cases each test case is independent of another test case.
8. TestNG allows us to execute test cases based on the group. Let’s take a scenario where we have created two set of groups “Regression” & “Sanity”. If we want to execute the test case is possible in TestNG framework.
9. Parallel execution of Selenium test cases is possible in TestNG.

Comments

  1. This is an excellent post I would say thanks for sharing it for free. This is really what I wanted to read, hope in future you will continue sharing such an excellent articles.
    Selenium Course in Chennai
    Selenium Courses in Chennai

    ReplyDelete
  2. I am always searching online for articles that can help. There is obviously a lot to know about this. I think you made some good points
    testing training
    testing Courses in Chennai
    softwrae testing Course

    ReplyDelete
  3. It is astoundingly useful information. It will improve my knowledge in Selenium. Thankful to you for sharing this sublime site.
    Education | Article Submission sites | MBA Guide | Technology

    ReplyDelete
  4. we want some more information about this topic
    Selenium Training in Hyderabad

    ReplyDelete
  5. Hi
    Thanks for another great article on . I’m just getting started with looking at ways to improve. This article is a “keeper”. I Love this!!
    Selenium Training In Ameerpet Hyderabad

    ReplyDelete

Post a Comment

Popular posts from this blog

AutoIt in Selenium Webdriver

    AutoIt in Selenium Web driver Selenium is an open source tool. That designed to automate web-based applications on different browsers. But to handle window GUI and non-HTML popups in the application. AutoIt required as these window based activity are not handled by Selenium . What is AutoIt? AutoIt v3 is a freeware scripting language designed for automating. the Windows GUI and general scripting. the combination of keystrokes, mouse movement and window/control manipulation to automate tasks. It is way not possible or reliable with other languages. AutoIt is very small, self-contained and run on all versions of Windows. The face with no annoying “runtimes” required. In layman’s term, AutoIt is another automation tool. Selenium used for Desktop Automation rather Web Automation. It is a powerful tool. It does not automate desktop windows, button & for. it automates mouse movements & keystrokes too. Selenium IDE recording capability generat...

Jenkins used in maven

  What is Jenkins? The Jenkins is the most important open source continuous process of the combine with another tool. It is cross-platform and it can be used on Windows, Linux, Mac and Solaris environments. It is composed in Java. Jenkins most important usage to check the progress any job which can be any application state.  It stimulates preconfigured actions when an individual step occurs in tasks. The Jenkins allows us to take 1 more step further, and allow us to automate this execution of test cases. A little more work, you can configure such that your tests execute every time after deploys a new build. Checks in code Jenkins build a execute unit tests, now deploys the application to test environment. Jenkins builds and then executes your tests on the newly deployed application. This is essential the CI process that others have mentioned. At this point, the only thing that you need to real worry is the writing of your test automa...