To include TestNG to your build path, first, you have to install TestNG plugin in the Eclipse. Below steps will explain how to install TestNG plugin.
- Launch the Eclipse IDE and from the Help menu, click “Install New Software”.
- You will see a dialog window, click “Add” button.
- Type name as you wish lets take “TestNG” and type “http://beust.com/eclipse/” as location. Click OK.
- Click “I accept the terms of the license agreement” then click Finish.
- You may or may not encounter a Security warning if in case you do just click OK.
- Click Next again on the succeeding dialog box until it prompts you to Restart the Eclipse.
- You are all done now, just Click Yes.
Now Add TestNG library to your Project.
- Right-click on the Project and select Properties
- Select "Java Build Path" and Select "Libraries" tab
- Click "Add Library..."
- Select "TestNG" and click Next
- Click Finish.
- Then Click OK.
That's all. TestNG is added to your build path.