How to create java batch file from Intellij IDEA project (Selenium and TestNG)
1 answer
You need to first find the correct command line to enter in order to run the testng tests.
If you can customize it pom.xml
to work mvn clean test
, you can adapt it in Jenkins' assignment.
See TestNG Maven plug-ins for yours to pom.xml
include the correct plugins.
For selenium you can follow the tutorial " Maven and Jenkins with Selenium " Your dependencies should include:
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.45.0</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8</version>
<scope>test</scope>
</dependency>
Then a simple maven job with Jenkins with a target clean test
should be enough:
+1
source to share