TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

TestNG

Add the TestNG library to the project

Overview

To get started using TestNG in a project, we need to add the TestNG library to the project in the IDE or to the project build file as a dependency. This step is to fix the TestNG related errors in the project.

Steps to add the library

Launch Eclipse IDE.

Install TestNG in Eclipse IDE.

https://www.testingdocs.com/working-with-eclipse-installing-testng/

Create a TestNG test class with TestNG Annotations.

https://www.testingdocs.com/create-testng-test-class-in-eclipse-ide/

Add TestNG library

 

Click on the Error mark and choose the Add TestNG library option to add the TestNG library to the project. This option will add the library to the project’s build classpath. Successful addition would clear all the TestNG related errors in the test class.

Maven project

Most test automation projects that use Selenium Webdriver and follow the TDD(Test Driven Development)approach are built with TestNG framework. To add TestNG to the Maven project, open the pom.xml file. Add the TestNG dependency.

<dependency>
 <groupId>org.testng</groupId>
 <artifactId>testng</artifactId>
 <version>6.10</version>
 <scope>test</scope>
</dependency>

 

 

TestNG Tutorials on this website can be found at:

https://www.testingdocs.com/testng-framework-tutorial/

For more details on the TestNG Framework, visit the official website of TestNG at:

https://testng.org

Related Posts

Tests TestNG Suite testng.xml

TestNG /

Run tests from TestNG Suite testng.xml file

new TestNG class

TestNG /

Create TestNG test class in Eclipse IDE.

TestNG Plugin IntelliJ

TestNG /

Enable TestNG in IntelliJ IDE

Installing Eclipse from Update Site

TestNG /

Install TestNG latest version from the update site

Before and After TestNG Annotations

TestNG /

TestNG Before and After Annotations

‹ Create TestNG test class in Eclipse IDE.› Run tests from TestNG Suite testng.xml file

Recent Posts

  • MS Access Data Types
  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Build & Run CLion Project
  • Create New CLion C Project on Windows
  • Configure CLion Toolchains on Windows
  • Launch CLion IDE on Windows
  • Activate CLion IDE
  • CLion IDE for C/C++ Development

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com

Go to mobile version