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.
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.
ReplyDeleteSelenium Course in Chennai
Selenium Courses in Chennai
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
ReplyDeletetesting training
testing Courses in Chennai
softwrae testing Course
It is astoundingly useful information. It will improve my knowledge in Selenium. Thankful to you for sharing this sublime site.
ReplyDeleteEducation | Article Submission sites | MBA Guide | Technology
we want some more information about this topic
ReplyDeleteSelenium Training in Hyderabad
Hi
ReplyDeleteThanks 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