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
• 2,520 points
40 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
• 2,450 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,530 points
186 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 in Jenkins by Sirajul
• 16,640 points
103 views
0 votes
2 answers

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

In case you want to change the ...READ MORE

answered Jul 31 in Jenkins by Sirajul
• 16,640 points
1,229 views
+13 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 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
110 views
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,610 points
215 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 in Jenkins by Sirajul
• 16,640 points
50 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
• 2,450 points
30 views