Learn Selenium and Java for Selenium

Sunday, 1 May 2016

TestNG and its Installation

What is TestNG?


TestNG is a testing framework for the java programming language inspired by JUnit and NUnit.The design goal is to cover wide range of Testing: Unit,Functional ,Regression etc.


Advantages of TestNG

  • TestNG supports many powerful features & it is easy to use. Let’s see what all new features are supported in new testing framework:
  • Support for parameters.
  • Supports dependent methods testing.
  • Test configuration flexible.
  • Supports powerful execution model.
  • TestNG has a more elegant way of handling parameterized tests with the data-provider concept.
  • For the same test class TestNG support for multiple instances.
  • Extendibility of using different Tools and plug-ins like Eclipse, Maven, IDEA etc.
  • Default JDK functions for runtime and logging (no dependencies).
  • Supported different Annotations like @BeforeSuite, @AfterSuite, @BeforeClass, @AfterClass, @BeforeTest, @AfterTest, @BeforeGroups, @AfterGroups, @BeforeMethod, @AfterMethod, @DataProvider, @Factory, @Listeners, @Parameters, @Test.
  • TestNG allows us to generate test reports in both HTML and XML formats.

How to Install TestNG and configure it in Eclipse?

Steps for installation:

1. Click Help –> Install New Software










2. Type “http://beust.com/eclipse” in the “Work with” edit box and click ‘Add’ button

3. In the ‘Name’ column we can see “TestNG” –> Select this and click ‘Next’ button




4. Click Next and click on the radio button “I accept the terms of the license agreement”

5. Click ‘Next’ button

6. Click ‘Finish’




This will install the TestNG plug-in for Eclipse

After the installation, it will ask for restart of Eclipse. Then restart the Eclipse.

Once the Eclipse is restarted, we can see the TestNG icons & menu items as in the below figures.








0 comments:

Post a Comment

Popular Posts

Recent Posts



Newsletter

Join our newsletter to get secret tips directly in your inbox!


*We Hate Spam!

Powered by Blogger.