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, 2019 in Jenkins by Arvind
• 3,050 points
4,072 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, 2019 by Neel
• 3,020 points

Related Questions In Jenkins

+2 votes
4 answers
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
• 10,620 points
3,575 views
0 votes
3 answers

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

To automatically run build on code commit, follow ...READ MORE

answered Aug 7, 2019 in Jenkins by Sirajul
• 59,230 points
4,967 views
+1 vote
1 answer

How to run selenium test kit in Jenkins remotely?

Selenium tests can be run on remote ...READ MORE

answered Apr 1, 2020 in Jenkins by Liana
1,909 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,034 views
0 votes
2 answers

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

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

answered Sep 4, 2020 in Selenium by Sri
• 3,190 points
2,890 views
0 votes
2 answers

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

You could use the Post Build Task Plugin ...READ MORE

answered Jul 31, 2019 in Jenkins by Sirajul
• 59,230 points
29,465 views
+2 votes
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, 2019 in Jenkins by Neel
• 3,020 points
27,471 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP