Saturday, March 15, 2014

TestNG SetUp With Eclips

TestNG(Test Next Generation) is nothing but a unit testing framework but using it we can do functional testing, integration and many other of testing can be done.We later know how to use this in Selenium WebDriver .TestNG is come with NetBeans so here we know how to add this in Eclips.

There is two way
  1. Add TestNG jar to the particular project.
  2. Add TestNG as a plugin.
Keep in mind that there is only difference is that if we add TestNg as a plugin it is applicable for all project and if we add it as a jar then it is only available for the particular project.

Step For Installation:

Step1:
  • Launch Eclipse (Here we use Kepler).
  • On the menu bar, click Help.
  • Choose the "Install New Software..." option.
Step 2:
  •  In the Install dialog box, click the Add button.
  • In "Name", type TestNG.
  • In "Location", type http://beust.com/eclipse .
  • Click OK
 Step3.
  • Notice that "TestNG - http://beust.com/eclipse" was populated onto the "Work with:" textbox.
  • Check the "TestNG" check box as shown below, then click Next.
  • Select the check box and follow the instruction like accept license and some click on the next button.
                                


 Or we can escape the above steps and just go to the Help->Eclipse Marketplace
             
      and give the name TestNG as a product.
 



Step 4:
  • After that need to restart the IDE.
  • Go to the Run As option and TestNG should be there.


 Step 5:
  • Create a project project from File ->New->Other->TestNG->TestNGclass.
           




  • Create class for testing
  
  • Click finish.


Step 6:
  • Right click on file from project pane(Right hand side of the IDE).
  • RunAs ->TestNG Test.
  • Result should be shown like that.
     


 

No comments:

Post a Comment