How to run selenium script with TestNG on Jenkins?

0 votes
I have a selenium java project with testng. This project works fine in Eclipse. Now I want to execute this project using Jenkins. how to do it in Jenkins?
Jun 19 in Jenkins by Arvind
• 1,530 points
23 views

1 answer to this question.

0 votes
You can build this project in Jenkins using Ant or Maven. Let us assume that you are using Maven

You can follow these steps -

1. Create a new job by clicking new item in Jenkins.

2. Select Maven project in the option. If Maven project option is not available then you need to install maven plugin and then follow these steps.

3. Give a name to the job and click ok.

4. Now go to manage jenkins and then configure system. Here make sure you have JDK installed and correct JAVA_HOME. Same things for Maven.

5. Now go to the build section of the new job. In the root POM enter the path to your pom.xml file. In the goals and options enter clean install or clean test or whatever maven commands that you wish to execute. Then click on apply.

6. Now go to your project page and click on build now option. now maven will build the project and testng will run the test cases. Once the build process is done, you can click on the project on the jenkins dashboard. You can now see the result of your project.You can also the output in the console output option.
answered Jun 19 by Neel
• 1,610 points

Related Questions In Jenkins

0 votes
1 answer

I’m facing a login error when I try to run Jenkins on Docker. How do I solve this?

You have to open the /var/log/jenkins/jenkins.log file to ...READ MORE

answered Jul 24, 2018 in Jenkins by Sophie may
• 9,430 points
151 views
0 votes
2 answers

How can I make Jenkins CI with Git trigger on pushes to master?

Generic webhook trigger can be useful When configured ...READ MORE

answered Aug 13, 2018 in Jenkins by lina
• 8,100 points
86 views
0 votes
1 answer

How to start Jenkins on a different port rather than 8080?

This is simple, use the following command: java ...READ MORE

answered Jul 4, 2018 in Jenkins by Sophie may
• 9,430 points
1,072 views
+13 votes
2 answers
0 votes
1 answer

What is the role of TestNG & JUnit frameworks in Selenium?

Well TestNG and JUnit are test frameworks ...READ MORE

answered Apr 18, 2018 in Selenium by king_kenny
• 3,590 points
192 views
0 votes
1 answer

how to execute a shell script post build step in Jenkins?

When you configure your jenkins job there ...READ MORE

answered Jun 24 in Jenkins by Neel
• 1,610 points
26 views
+1 vote
1 answer

How to run a job in Jekins by a different user ?

To run a job by a specific ...READ MORE

answered Jun 17 in Jenkins by Neel
• 1,610 points
15 views