TestNG

Test Automation 0 Comment 10

TestNg:–  Test new generation

In selenium using java  their are two frameworks available

  •  JUnit
  •  TestNg
  1. Available as a plugin in eclipse IDE and as a jar file in SWD jars.
  2. It works like a JUnit.
  3. TestNG is designed to cover all categories of tests:  unit, functional, end-to-end, integration, etc…
  4. TestNG is a testing framework inspired from JUnit and NUnit but introducing some new functionalities that make it more powerful and easier to use, such as:
  •  Annotations.
  • Run your tests in arbitrarily big thread pools with various policies available (all methods in their own thread, one thread per test class, etc…).
  • Test that your code is multi thread safe.
  • Flexible test configuration.
  • Support for data-driven testing (with @DataProvider).
  • Support for parameters.
  • Powerful execution model (no more TestSuite).
  • Supported by a variety of tools and plug-ins (Eclipse, IDEA, Maven, etc…).
  • Embeds BeanShell for further flexibility.
  • Default JDK functions for runtime and logging (no dependencies).
  • Dependent methods for application server testing.

Installation

There are two ways in installing TestNG in Eclipse

First Way on installing Eclipse is using “Install new software” option.
Second way is using “Eclipse Market Place”. – This option will be available in new versions of eclipse

Way 1;

Step 1 : In Eclipse, on top menu bar, Under Help Menu, Click on “Install new Software” in help window.

Install New Software
Step 2: 

Enter the URL (http://beust.com/eclipse/) at Work With field and click on “Add” button.TestNg URL

Step 3:
Once you click on “Add”, it will display the screen, Enter the Name as “TestNG”.

Add Respository

Step 4:
After clicking on “OK”, it will scan and display the software available with the URL which you have mentioned.

Now select the checkbox at TestNG and Click on “Next” button.
Install TestNG

Step 5:
It will check for the requirement and dependencies before starting the installation.

If there is any problem with the requirements/dependencies, it will ask you to install them first before continuing with TestNG. Most of the cases it will successfully get installed nothing to worry about it.

TestNG Dependencies

Step 6:
Once the above step is done, it will ask you to review the installation details. If your are ready or Ok to install TestNG, click on “Next” to continue.

 

Step 7:
Accept the Terms of the license agreement and Click on “Finish” button.

TestNg Accept

Thats it… It will take few minutes to get installed.

Finally once the installation is done, you can check if the TestNG is installed properly or Not.

Go to Windows Menu bar, and Mouse Over on “Show View” and Click on “Other” at the last as in the below screen shot.

TestNg check

Expand Java folder and see if the TestNg is available as in the below screen shot.

TestNg Java

UPDATE:
Now eclipse is coming with Marketplace plugin by default which is a rich client solution for installing solutions listed on Eclipse Marketplace directly from an Eclipse. We can easily find third-party plugins that users can add to their Eclipse installation by using search option.

 

Way: 2

TestNG can  be installed in Eclipse by using Marketplace. Below are the steps:

  • Open eclipse
  • Go to Help -> Eclipse Marketplace…

Eclipse Market Place TestNG

 

  • Do search for TestNG (Type the text TestNG in Find text box > Click Go button)

Eclipse Market Place Install TestNG

  • After searching: Click Install button at TestNG for Eclipse area
  • Follow the further instructions by eclipse.
  • Click Install . two check boxes appear testng and testng integration.
  • Deselect testng integration.
  • Click next untill finish.
  • Restart Eclipse IDE.

Author

Related Articles

Leave a comment

You must be logged in to post a comment.

© 2016 4frienz. Powered By Flowers

Back to Top