Transcripted Summary

In this chapter, we will discuss the various ways to install TestNG and then demonstrate hoow to install TestNG using Eclipse.

# Ways To Install TestNG

Let’s start with the compatible IDEs. IDE stands for Integrated Development Environment. The compatible IDEs are Eclipse, NetBeans, and IntelliJ. Next, we can setup TestNG using build tools Ant or Maven.

In addition to the IDEs and build tools, we can use the command line or download the TestNG jars. The focus in this chapter will be installing TestNG using Eclipse but I will provide a reference link for NetBeans, IntelliJ, Ant, and Maven.

# How To Install TestNG Using Eclipse Marketplace

First, I’ll show you to how install TestNG using Eclipse Marketplace.

  1. Go to Help

  2. Select Eclipse Marketplace

  3. Type TestNG in the Find text box

  4. Click the Go button

  5. Click the Install button

  6. Click the Confirm button after making sure all of the checkboxes are checked

  7. Select "I accept the terms of the license agreement"

  8. Click Finish

    Note

    A security warning shows up to let you know you are installing software that contains unsigned content. This shows up because TestNG is 3rd Party plugin.

  9. Click Install anyway

  10. Click Restart Now to restart Eclipse


# How To Install TestNG Using Install New Software

Another way to install TestNG is through "Install New Software".

  1. Go to Help
  2. Select Install New Software
  3. Type TestNG
  4. Click Enter
    • If TestNG Eclipse does not come up for you as an auto-suggestion then click the Add button
    • In the Add Repository pop-up, type TestNG for Name and http://beust.com/eclipse for Location
    • Click OK
    • Select the checkbox for TestNG
    • Click Next
    • Accept the License Agreement
    • Click Finish button.

After installing TestNG, we must add the TestNG Library.

# Add TestNG Library

We have the option of adding our TestNG Library now or waiting until we import an annotation. Let’s go ahead and add the TestNG Library now. There’s more than one way to add a TestNG Library but we are going to do so by configuring the build path.

  1. Right click on the src directory within the Package Explorer
  2. Right click JRE System Library (or Referenced Libraries)
  3. Select Build Path
  4. Select Configure Build Path
  5. Select Classpath
  6. Click the Add Library button
  7. Select TestNG
  8. Click Next
  9. Click Finish (now we see TestNG()
  10. Click the Apply and Close button.

We are finished installing TestNG and adding TestNG as a library.

# Other Methods



Resources



© 2024 Applitools. All rights reserved. Terms and Conditions Privacy Policy GDPR