Sunday, 8 March 2020

Setup TestNG Project in Eclipse

Open Eclipse.

File -> New -> Maven Project.

Select the checkbox ‘Create a simple project (skip archetype selection).

Click on Next button.

Give group id as 'com.sample.app',
Artifact id as 'testng'
version as 1

Click on Finish button.

Project structure looks like below.

Open pom.xml and add testing dependency.

<!-- https://mvnrepository.com/artifact/org.testng/testng -->
<dependency>
    <groupId>org.testng</groupId>
    <artifactId>testng</artifactId>
    <version>7.0.0</version>
    <scope>test</scope>
</dependency>

pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 <modelVersion>4.0.0</modelVersion>
 <groupId>com.sample.app</groupId>
 <artifactId>testng</artifactId>
 <version>1</version>

 <dependencies>
  <!-- https://mvnrepository.com/artifact/org.testng/testng -->
  <dependency>
   <groupId>org.testng</groupId>
   <artifactId>testng</artifactId>
   <version>7.0.0</version>
   <scope>test</scope>
  </dependency>

 </dependencies>
</project>




Previous                                                    Next                                                    Home

No comments:

Post a Comment