<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Piyusha</title>
    <description>The latest articles on Forem by Piyusha (@piyusha).</description>
    <link>https://forem.com/piyusha</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F134611%2F2f7abc46-067f-47dd-b896-3f847cf8b966.png</url>
      <title>Forem: Piyusha</title>
      <link>https://forem.com/piyusha</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/piyusha"/>
    <language>en</language>
    <item>
      <title>Jenkins Vs. GoCD: Battle Of CI/CD Tools</title>
      <dc:creator>Piyusha</dc:creator>
      <pubDate>Thu, 01 Jul 2021 08:28:49 +0000</pubDate>
      <link>https://forem.com/piyusha/jenkins-vs-gocd-battle-of-ci-cd-tools-2jde</link>
      <guid>https://forem.com/piyusha/jenkins-vs-gocd-battle-of-ci-cd-tools-2jde</guid>
      <description>&lt;p&gt;If you focus on continuous delivery or continuous deployment, you might have come across tools like Jenkins and GoCD. &lt;a href="https://www.lambdatest.com/learning-hub/jenkins?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Piyusha-1072021&amp;amp;utm_term=Piyusha"&gt;Jenkins&lt;/a&gt; is a potent tool that allows you to use plugins available from its vast store. However, the ride to get started with Jenkins is tough, whereas GoCD has an effortless learning curve for beginners and experienced folks. But which one to choose for your project?&lt;/p&gt;

&lt;p&gt;We know this question can perplex you while choosing the right CD tool for your DevOps testing project. That is why we have brought you this comprehensive guide on Jenkins vs GoCD to help you choose the most appropriate CD tool for your project’s Selenium automation testing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Jenkins Vs GoCD: A High-Level Comparison
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Jenkins
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--I4Ce6l8o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/05/Jenkins.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--I4Ce6l8o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/05/Jenkins.png" alt="Jenkins"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With over 17.4K GitHub stars and 6.8k forks on GitHub, Jenkins is the most popular open-source automation server written in Java. It supports a plethora of plugins, over 1500, across different software categories. This has made Jenkins the go-to choice for the automation process of CI/CD in the software development process of over 2000 companies, like Facebook, Netflix, and Instacart.&lt;/p&gt;

&lt;p&gt;But with the vast amount of plugins, Jenkins also has a huge learning curve to start with, which is why developers and companies are still on the lookout for the &lt;a href="https://www.lambdatest.com/blog/31-best-ci-cd-tools/"&gt;best CI/CD tool&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Co7SwkzS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/05/best-CI-CD-tool-1024x504.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Co7SwkzS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/05/best-CI-CD-tool-1024x504.png" alt="best CI-CD tool"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To help you out, here are a few Pros of Jenkinsconsiderable that would help you get an overview on the reasons to assess Jenkins.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Available for cross-platform, i.e., Windows, Linux, and macOS platforms.&lt;/li&gt;
&lt;li&gt;Free and open-source. Hence, it is preferable for startups as well as large-scale organisations.&lt;/li&gt;
&lt;li&gt;16.3K Star &amp;amp; 6.5k Forked Repo on GitHub.&lt;/li&gt;
&lt;li&gt;Highly extensible.&lt;/li&gt;
&lt;li&gt;It has a thriving plugin ecosystem (1500+ plugins) and a best-in-class community.&lt;/li&gt;
&lt;li&gt;Integrates with popular cloud platforms such as AWS, Google Cloud, Azure, Digital Ocean, and more.&lt;/li&gt;
&lt;li&gt;It can be leveraged for performing work in parallel and realising complex CD requirements.&lt;/li&gt;
&lt;li&gt;The installer in the .war format is a stand-alone Java application and works out of the box.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Jenkins was developed as continuous integration (CI) tool initially for DevOps testing. So to work with anything other than CI, like CD, a plugin is required. And even though it is enriched with several plugins, a piece of in-depth knowledge is needed to make sure the correct plugin can be installed. Thus, developers and companies are looking out for other CI/CD tools to replace Jenkins, such as GoCD.&lt;/p&gt;

&lt;h3&gt;
  
  
  GoCD
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Vdt8_AA7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/05/GoCD.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Vdt8_AA7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/05/GoCD.png" alt="GoCD"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are looking for continuous delivery or continuous deployment in the software cycle, GoCD can be a good Jenkins alternative. It is used to automate the entire phase of build-test-release, from code check-in to deployment. Being an open-source tool with over 6.1K GitHub stars and 884 GitHub forks, GoCD is used in 40+ companies, including Thoughtworks, Hazeorid, and OpenX.&lt;/p&gt;

&lt;p&gt;There are certain advantages of GoCD that make it a prominent Jenkins alternative for continuous delivery/deployment, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It allows for flexible and easy setup for the deployment Pipeline.&lt;/li&gt;
&lt;li&gt;It is highly customizable to diverse requirements.&lt;/li&gt;
&lt;li&gt;It supports both Linux and Windows systems.&lt;/li&gt;
&lt;li&gt;We can configure environment variables for each step.&lt;/li&gt;
&lt;li&gt;Extensively used for continuous deployment and testing management.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even though GoCD is easy to use and can be easily set up for the CD pipeline, its deficiency in the field of CI makes it a challenge for the companies and developers to opt GoCD alternatives such as Jenkins.&lt;/p&gt;

&lt;p&gt;Below table is a quick guide to what features you can look for and are supported by GoCD and Jenkins.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0IN7ym0T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ucarecdn.com/cdb87a30-dafe-46cb-8f8a-35912ce55682/" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0IN7ym0T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ucarecdn.com/cdb87a30-dafe-46cb-8f8a-35912ce55682/" alt="Capture.PNG"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JY0ns-Hb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ucarecdn.com/f6a4deea-4c81-449e-a719-093db3129729/" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JY0ns-Hb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ucarecdn.com/f6a4deea-4c81-449e-a719-093db3129729/" alt="Capture1.PNG"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aX5m5LQL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ucarecdn.com/c95f3ab1-530f-4efa-acb4-dc81b69baa29/" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aX5m5LQL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ucarecdn.com/c95f3ab1-530f-4efa-acb4-dc81b69baa29/" alt="Capture2.PNG"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_uSWAUoT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ucarecdn.com/47fc6ed1-a1ad-4624-af6c-39e44bbd74e4/" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_uSWAUoT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ucarecdn.com/47fc6ed1-a1ad-4624-af6c-39e44bbd74e4/" alt="Capture3.PNG"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jYh-Jhkz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ucarecdn.com/c6ec42cf-8f1b-450e-acc9-903d0bc86f71/" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jYh-Jhkz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ucarecdn.com/c6ec42cf-8f1b-450e-acc9-903d0bc86f71/" alt="Capture4.PNG"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QwjBVC9t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ucarecdn.com/d8198e1e-88dc-43e2-82eb-8d6b20df7fb8/" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QwjBVC9t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ucarecdn.com/d8198e1e-88dc-43e2-82eb-8d6b20df7fb8/" alt="Capture5.PNG"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Jenkins Vs GoCD: Which One To Choose And Why
&lt;/h2&gt;

&lt;p&gt;Both Jenkins and GoCD have their own pros and cons, but which one to choose is still a dilemma for many. So let’s do a head-on comparison of Jenkins vs GoCD, and help you choose the right CI/CD tool without a blink.&lt;/p&gt;

&lt;h3&gt;
  
  
  Philosophy
&lt;/h3&gt;

&lt;p&gt;With the aim to support the common scenarios of continuous delivery/deployment without use of any plugin, GoCD is one the best CD tools to look out for. The credit goes to the GoCD’s model which maps to all the core concepts of CD pipelines.&lt;/p&gt;

&lt;p&gt;On the other hand Jenkins is a general all-purpose CI/CD tool. Whether it is CI or CD, you can definitely depend upon Jenkins due to the availability of 1000+ plugins.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Jenkins vs GoCD: Which one to choose based on Philosophy?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With a wide range of applications and maximum flexibility, Jenkins definitely has the edge over GoCD. But if you are looking for a single-purposed, focused tool, you can use GoCD.&lt;/p&gt;

&lt;h3&gt;
  
  
  Continuous Delivery
&lt;/h3&gt;

&lt;p&gt;As the name suggests, GoCD is single handedly devoted towards CD or continuous delivery. Their aim is to make GoCD as the most prominent tool for continuous delivery.&lt;/p&gt;

&lt;p&gt;Since Jenkins was developed with the initial goal of serving the purpose of CI, CD is still a challenge with Jenkins. The only practical way of using CD over Jenkins is with the help of some plugin. With the introduction of Jenkins 2.0, Jenkins has made a lot of improvement, but still, it is not clear if CD fits in this.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Jenkins vs GoCD: Which one to choose based on Continuous Delivery?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With the single point focus over CD, and with wide CD community support, GoCD is definitely the right choice if you are looking for only a CD tool. But since CI and CD are usually intermingled in the software development cycle, and since there is a huge demand for an all-purpose CI/CD tool, Jenkins will serve you well.&lt;/p&gt;

&lt;h3&gt;
  
  
  Getting Started
&lt;/h3&gt;

&lt;p&gt;GoCD has a getting started tutorial which is pretty easy to follow. Due to this GoCD has a very smooth learning curve that can easily pick up beginners as well as experienced.&lt;/p&gt;

&lt;p&gt;Jenkins has improved the getting started experience by a lot from the release of Jenkins 2.0, but still installing the right mix of plugins can be a challenge based on the use case. Also, it’s not sure with Jenkins that a single plugin will solve all the purpose. You might need to switch between plugins depending on the scenario.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Jenkins vs GoCD: Which one to choose based on Getting Started?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Both Jenkins and GoCD can be challenging if you want to dive right in. GoCD’s model can be difficult to work with if switching from a pure CI tool. But GoCD has a better getting started curve than Jenkins. Jenkins has hurdles around configuring required tools, unintuitive SCM configuration, and installing additional plugins. Although once you get hold of the plugins in Jenkins, it’s pretty easy to work with and can accomplish more use cases than GoCD.&lt;/p&gt;

&lt;h3&gt;
  
  
  Plugins
&lt;/h3&gt;

&lt;p&gt;GoCD aims to make implementing CD easy, and to do so it has few extension points like SCM, task, notifications, authentication, authorization, configuration, and elastic agents. But they are not focused on providing the pool of plugins as with the case with Jenkins, which makes GoCD less flexible.&lt;/p&gt;

&lt;p&gt;Jenkins, on the other hand, has a wide pool of plugins available to make it infinitely configurable, flexible and extendable. It would be not incorrect to say that the high popularity of Jenkins is gained from its availability of plugins. But, plugins are the same reason which makes Jenkins hard to use as well. The getting started and support for each plugin is different and this can be a challenge to the users.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Jenkins vs GoCD: Which one to choose based on Plugins?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you are looking for just a CD tool, and nothing else, with no scope of flexibility whatsoever, GoCD is the right choice for you, as it clearly has no intention of supporting a pool of plugins. But if you are looking for a much more flexible CI/CD tool, which is configurable, you should opt for Jenkins, if it matches your needs and uses case.&lt;/p&gt;

&lt;h2&gt;
  
  
  Jenkins Vs GoCD: Side-By-Side Comparison
&lt;/h2&gt;

&lt;p&gt;To summarize, the below table charts the primary comparisons between GoCD &amp;amp; Jenkins based on various parameters.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---_eoMkgz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ucarecdn.com/90247298-0970-4a64-a345-a0f6272ac51a/" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---_eoMkgz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ucarecdn.com/90247298-0970-4a64-a345-a0f6272ac51a/" alt="Capture.PNG"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gfOcLtjD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ucarecdn.com/51290fab-86b3-4695-b91b-c1174d0a078a/" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gfOcLtjD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ucarecdn.com/51290fab-86b3-4695-b91b-c1174d0a078a/" alt="Capture1.PNG"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jzXqfhB5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ucarecdn.com/f70252d0-9654-493a-abd8-5f1af48423cf/" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jzXqfhB5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ucarecdn.com/f70252d0-9654-493a-abd8-5f1af48423cf/" alt="Capture3.PNG"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Jenkins vs GoCD: Which CI/CD Tool Should You Prefer?
&lt;/h2&gt;

&lt;p&gt;Both Jenkins and GoCD have their own pros and cons but your final choice between the two CI/CD tools depends upon the project requirements and specification. With their advantages and disadvantages, both the tools aim to accomplish the same goal: automating processes for CI/CD (Continuous Integration &amp;amp; Continuous Delivery/Deployment).&lt;/p&gt;

&lt;p&gt;Jenkins is for CI and CD whereas GoCD is for CD only. So apart from the comparison of features among the two, you should also focus on the in-house requirements to choose the most appropriate tool for DevOps testing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fun Fact:&lt;/strong&gt; From a DevOps testing perspective, it doesn’t matter whether you choose Jenkins or GoCD, as LambdaTest offers integrations with Jenkins, GoCD, as well as other CI/CD tools via its &lt;a href="https://www.lambdatest.com/selenium-automation?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Piyusha-1072021&amp;amp;utm_term=Piyusha"&gt;cloud based Selenium Grid&lt;/a&gt;. The best part is, you can test and validate your new builds in the pipeline on over 2000+ real browsers, browser versions, and operating systems and expedite your Selenium automation testing once you have chosen the best DevOps testing tool.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qcplnTzk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/05/cloud-based-Selenium-Grid-1024x576.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qcplnTzk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/05/cloud-based-Selenium-Grid-1024x576.png" alt="cloud-based Selenium Grid"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also check out the rest of the &lt;a href="https://www.lambdatest.com/integrations#cicd_row?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Piyusha-1072021&amp;amp;utm_term=Piyusha"&gt;LambdaTest CI/CD integrations&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Happy Testing!&lt;/p&gt;

</description>
      <category>cicd</category>
      <category>jenkins</category>
      <category>gocd</category>
      <category>devops</category>
    </item>
    <item>
      <title>How To Create &amp; Run A Job In Jenkins Using Jenkins Freestyle Project?</title>
      <dc:creator>Piyusha</dc:creator>
      <pubDate>Thu, 20 May 2021 10:44:23 +0000</pubDate>
      <link>https://forem.com/piyusha/how-to-create-run-a-job-in-jenkins-using-jenkins-freestyle-project-3phf</link>
      <guid>https://forem.com/piyusha/how-to-create-run-a-job-in-jenkins-using-jenkins-freestyle-project-3phf</guid>
      <description>&lt;p&gt;As per the official Jenkins wiki information, a Jenkins freestyle project is a typical build job or task. This may be as simple as building or packaging an application, running tests, building or sending a report, or even merely running few commands. Collating data for tests can also be done by Jenkins.&lt;/p&gt;

&lt;p&gt;For instance, a real-world scenario could involve Jenkins allowing you to submit reports to log management at any specified stage concerning management, which may include details about artifacts or shipping application logs. To get a better understanding, we will dive deeper into how to create a job in Jenkins &amp;amp; eventually a Jenkins freestyle project.&lt;/p&gt;

&lt;p&gt;Let’s find out more about Jenkins Build Job before we begin creating a Freestyle project.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Build Job?
&lt;/h2&gt;

&lt;p&gt;The Build jobs are at the heart of any Jenkins build process. To put it plainly, imagine a Jenkins build job as a particular task or step in your entire build process. The task or step could involve merely compiling the source code and running your unit tests over. Or you can configure a build job to do other co-related tasks, such as&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Measuring code coverage or code quality metrics.&lt;/li&gt;
&lt;li&gt;Running your integration tests.&lt;/li&gt;
&lt;li&gt;Generating technical documentation.&lt;/li&gt;
&lt;li&gt;And even deploying the application to a web server.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Generally, a real project requires many separate but related build jobs in a CI or DevOps cycle.&lt;/p&gt;

&lt;p&gt;Let us first understand what the Jenkins Freestyle project is and how we can create it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Jenkins Freestyle Project?
&lt;/h2&gt;

&lt;p&gt;Jenkins supports different types of build jobs. The two most commonly used Jenkins build jobs are-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Freestyle builds &lt;/li&gt;
&lt;li&gt;Maven 2/3 builds&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The best part about the Jenkins freestyle project is that it allows you to configure just about any build job, thus making them highly flexible and configurable. The &lt;a href="https://www.lambdatest.com/blog/getting-started-with-maven-for-selenium-testing/?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Piyusha-20052021&amp;amp;utm_term=Piyusha" rel="noopener noreferrer"&gt;Maven&lt;/a&gt; 2/3 builds, on the other hand, understand the Maven project structure and let you set up Maven build jobs quickly with added features.&lt;/p&gt;

&lt;p&gt;In a freestyle build job, you can break down your build job into several smaller build steps, making it easier to organize builds in separate stages. E.g., in one step, a build might run a suite of functional tests and then tag the build in a second step if all functional tests are successful. It may be appropriate to invoke an Ant task or a Maven target or run a shell script in a technical terms build phase.&lt;/p&gt;

&lt;p&gt;Various other Jenkins plugins also let you use additional types of build steps. These involve Grails, Gant, Rake, Gradle, Ruby, MSBuild, etc. But what highlights a Jenkins Freestyle project is that it lets you create general-purpose build jobs with maximum flexibility.&lt;/p&gt;

&lt;p&gt;So the bottom line is- the freestyle projects allow you to configure just about any build job.&lt;/p&gt;

&lt;p&gt;A Jenkins project involves steps and post-build actions and is a repeatable build job. There are limitations in the types of actions you can perform in a build step or post-build action. Within a Jenkins freestyle project, there are several standard plugins available to help you overcome this problem. These plugins allow you to configure build triggers and offer project-based security for the Jenkins project.&lt;/p&gt;

&lt;h3&gt;
  
  
  When to Use a Jenkins Freestyle Project?
&lt;/h3&gt;

&lt;p&gt;An access to the shell or a batch environment propagates a high level of security access for the Jenkins freestyle project. In freestyle project environments, it’s convenient to create a script that instructs a Jenkins freestyle job to FTP a file from one server to another, compile a directory of Java code, or even run a SonarQube test. A Jenkins freestyle job can be as powerful and complex as any build job built with a Jenkins pipeline or a Groovy DSL. But the only drawback to freestyle projects is that the user must know how to script all of these actions, and developers need to learn how to manage these scripts.&lt;/p&gt;

&lt;p&gt;Plugins such as Git, Maven, and SonarQube are the preferred way to access resources. And technologically, every developer can write a script to access those resources within a Jenkins freestyle project. However, it is recommended that every developer in the development team should follow the guided security best practices and inhibit from adapting a scripted approach.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating a Freestyle Build Job
&lt;/h2&gt;

&lt;p&gt;To set up freestyle projects using Jenkins, we need to ensure that we have Jenkins installed and up and running. Also, it is mandatory to be authenticated as the ‘Admin.’ You can refer to our hands-on &lt;a href="https://www.lambdatest.com/blog/what-is-jenkins/?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Piyusha-20052021&amp;amp;utm_term=Piyusha" rel="noopener noreferrer"&gt;Jenkins tutorial&lt;/a&gt; to learn more.&lt;/p&gt;

&lt;p&gt;Once you have Jenkins up &amp;amp; ready, let us create a Jenkins freestyle job.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Get logged on to your Jenkins dashboard through the Jenkins installation path. &lt;/li&gt;
&lt;li&gt;Unless you have defined a private host, it will be hosted on the localhost at &lt;a href="http://localhost:8080" rel="noopener noreferrer"&gt;http://localhost:8080&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;In case your Jenkins is installed in another path, make sure to use the appropriate URL to access the dashboard.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2F091318_0458_HowtoCreate2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2F091318_0458_HowtoCreate2.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt;. Go to the “ &lt;strong&gt;New Item&lt;/strong&gt; ” option at the top left-hand side of your main dashboard.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2Fmain-dashboard.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2Fmain-dashboard.png" alt="main dashboard"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3&lt;/strong&gt;. On the next screen,&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Here enter the name of the item you want to create. Let us use the “Hello world.”&lt;/li&gt;
&lt;li&gt;Select ‘ &lt;strong&gt;Freestyle project&lt;/strong&gt; ’ as the option for this new Item.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;OK&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2F091318_0458_HowtoCreate4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2F091318_0458_HowtoCreate4.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When we hit Ok, Jenkins automatically takes us to the project configuration view, where we need to configure our project details. Additionally, we can provide intricate details through tab options.&lt;/p&gt;

&lt;p&gt;The first tab is the general details of the project. So the next step is to enter project details.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4.&lt;/strong&gt; Enter the project details in the &lt;strong&gt;General&lt;/strong&gt; tab, including the name and description of the project that needs to be tested.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2F091318_0458_HowtoCreate5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2F091318_0458_HowtoCreate5.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, let’s understand what the &lt;strong&gt;Source Code Management&lt;/strong&gt; tab does. It checks out code from version control hosts, which implies that if your code is hosted on GitHub or any other repositories, you have to add the repository details. Jenkins will clone the repository.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2FSource-Code-Management-1-1024x216.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2FSource-Code-Management-1-1024x216.png" alt="Source Code Management"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The blue question mark icons present at the right-hand bottom side serve us with quick tips, and they can be very resourceful and provide more clarification at times.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5&lt;/strong&gt;. Under &lt;strong&gt;Source Code Management&lt;/strong&gt; (SCM) tab,&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Select &lt;strong&gt;Git&lt;/strong&gt; as a repository source and enter your Git &lt;strong&gt;Repository URL&lt;/strong&gt;. &lt;/li&gt;
&lt;li&gt;In case you have your repository created locally, it is permissible to use a local repository.&lt;/li&gt;
&lt;li&gt;Suppose the GitHub repository you are using is private. In that case, Jenkins will validate the login credentials with GitHub, and upon successful validation, it will then pull the source code from your GitHub repository.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2F091318_0458_HowtoCreate6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2F091318_0458_HowtoCreate6.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After you have provided all the project &amp;amp; repo details, the next part is to build the code. You can manage the settings under the Build section to &lt;strong&gt;build&lt;/strong&gt; the code at your desired time. You can even schedule the build to run periodically if needed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6&lt;/strong&gt;. Go to the &lt;strong&gt;Build&lt;/strong&gt; section and click on the &lt;strong&gt;Add build&lt;/strong&gt; step.&lt;/p&gt;

&lt;p&gt;Under the &lt;strong&gt;build&lt;/strong&gt; section,&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click on the “ &lt;strong&gt;Add build step&lt;/strong&gt;.”&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2FAdd-build-step.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2FAdd-build-step.png" alt="Add build step"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Then, “ &lt;strong&gt;Execute Windows batch command&lt;/strong&gt; ” and add the commands you want to execute during the build process.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2FExecute-Windows-batch-command.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2FExecute-Windows-batch-command.png" alt="Execute Windows batch command"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;E.g., Java compile batch commands.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2F091318_0458_HowtoCreate8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2F091318_0458_HowtoCreate8.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 7&lt;/strong&gt;. When you have entered all the data,&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click &lt;strong&gt;Apply&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Save&lt;/strong&gt; the project.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 8&lt;/strong&gt;. On the left-hand side panel, click the &lt;strong&gt;Build Now&lt;/strong&gt; button to build the source code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2FHowtoCreate9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2FHowtoCreate9.png" alt="HowtoCreate9"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 9&lt;/strong&gt;. We can see the status of the build under &lt;strong&gt;Build History&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2F091318_0458_HowtoCreate10.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2F091318_0458_HowtoCreate10.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 10&lt;/strong&gt;. We can verify the history of the executed build under the Build History by clicking the build number. By clicking on the &lt;strong&gt;Build Number&lt;/strong&gt; –&amp;gt; &lt;strong&gt;Console Output&lt;/strong&gt; , it should show you a success or failure message depending on how the job ran.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2F091318_0458_HowtoCreate11-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2F091318_0458_HowtoCreate11-1.png" alt="HowtoCreate11"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To sum up, we ran a ‘HelloWorld’ program on GitHub. Jenkin pulled up the source code from the remote repository and continuously built it at a frequency you define.&lt;/p&gt;

&lt;h2&gt;
  
  
  Jenkins Freestyle Project for Docker Container Images
&lt;/h2&gt;

&lt;p&gt;The below demonstration is about creating a Jenkins Freestyle project that first builds a Docker image and then scans it for any vulnerabilities and compliance issues as a test over.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to the Jenkins top page.&lt;/li&gt;
&lt;li&gt;Create a new project.

&lt;ul&gt;
&lt;li&gt;Click on ‘ &lt;strong&gt;New Item&lt;/strong&gt;.’&lt;/li&gt;
&lt;li&gt;Enter a name for your project in ‘ &lt;strong&gt;Enter an item name&lt;/strong&gt;.’&lt;/li&gt;
&lt;li&gt;Select ‘ &lt;strong&gt;Freestyle project&lt;/strong&gt;.’&lt;/li&gt;
&lt;li&gt;Then click, &lt;strong&gt;OK&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2Fpasted-image-0-2-2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2Fpasted-image-0-2-2.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Next, add a build step.

&lt;ul&gt;
&lt;li&gt;In the &lt;strong&gt;Build section&lt;/strong&gt; → &lt;strong&gt;Add build step&lt;/strong&gt; → &lt;strong&gt;select Execute shell&lt;/strong&gt; → &lt;strong&gt;Command&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Enter the below command in the &lt;strong&gt;Command&lt;/strong&gt; text box.
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo "Creating Dockerfile..."
echo "FROM imiell/bad-dockerfile:latest" &amp;gt; Dockerfile
docker build --no-cache -t test/test-image:0.1 .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Include a build step that will scan for vulnerabilities in the container image(s).

&lt;ul&gt;
&lt;li&gt;Select &lt;strong&gt;Scan Prisma Cloud Images&lt;/strong&gt; in the &lt;strong&gt;Add Create Phase&lt;/strong&gt; drop-down list. &lt;/li&gt;
&lt;li&gt;Select the image to be scanned in the Image field by specifying the repository and tag. &lt;/li&gt;
&lt;li&gt;In case the image you want to scan is generated beyond this build, or if you want to scan for an image for each build, even if a new image is not generated by the build, then press &lt;strong&gt;Advanced&lt;/strong&gt; and select &lt;strong&gt;Ignore Image Development Time&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;To directly publish the scan results in Jenkins, add a post-build action.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This post-build step depends on a file created by the previous scan-build step, which contains the scan results. In the Jenkins build tool, this step explicitly makes the results available for review. Note that the results have already been published in the Console during the last scan phase, and they are ready for analysis there.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select &lt;strong&gt;Publish Prisma Cloud Analysis Results&lt;/strong&gt; from the drop-down menu under Add Post-Build Action. &lt;/li&gt;
&lt;li&gt;Accept the default in the Scan Result Folders. &lt;/li&gt;
&lt;li&gt;The publishing stage does not remove the result files from the scan. In the workspace, they remain.

&lt;ol&gt;
&lt;li&gt;Click &lt;strong&gt;Save&lt;/strong&gt; , then &lt;strong&gt;Build Now&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Examine the results after the build completes. In the following places, scan reports are available:&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Prisma Cloud Console: Log into Console, go to &lt;strong&gt;Monitor&lt;/strong&gt; –&amp;gt; &lt;strong&gt;Vulnerabilities&lt;/strong&gt; –&amp;gt; &lt;strong&gt;Images&lt;/strong&gt; –&amp;gt; &lt;strong&gt;CI&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Jenkins: Scroll down into the build job –&amp;gt; then click &lt;strong&gt;Image Vulnerabilities&lt;/strong&gt; to see a detailed report.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2Fjenkins_dashboard_scan_results-1024x435.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2Fjenkins_dashboard_scan_results-1024x435.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Jenkins Freestyle Project for Serverless Functions
&lt;/h2&gt;

&lt;p&gt;It is similar to the procedure for container images to set up Jenkins to scan serverless functions, except that you can use the Scan Prisma Cloud Functions construct step.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2FJenkins-Freestyle-1024x423.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2FJenkins-Freestyle-1024x423.png" alt="Jenkins Freestyle"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Function Path —&lt;/strong&gt;  Path to the function’s ZIP archive to scan.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Function Name —&lt;/strong&gt;   (This is Optional) Identifier string to align policy rules in the Console with scanned functions. When you build policy rules in the Console, the function name will target specific rules to specific functions. If this field is left undefined, the plugin fits the first rule function, where the name of the function is a wildcard.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AWS CloudFormation template file —&lt;/strong&gt;  (This is Optional) Path to a template file in either JSON or YAML format with CloudFormation. Prisma Cloud checks the source code of the function for the AWS service APIs that are used, compares the APIs used with the permissions of the function, and reports when the functions have permissions for APIs they do not need.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Converting a Project from Jenkins Freestyle project to a Declarative Pipeline
&lt;/h2&gt;

&lt;p&gt;In Jenkins, managing freestyle jobs is cumbersome. Declarative Pipelines offer a more modern and suggested solution. It is time-consuming and error-prone, however, to try to convert Freestyle jobs to Declarative Pipelines manually. You can use the Migration Assistant Declarative Pipeline plugin to streamline this operation. During the conversion, the Declarative Pipeline Migration Assistant uses a best-effort approach: supported configurations are converted automatically in Freestyle projects, and placeholder stages are generated for plugins that are not yet supported.&lt;/p&gt;

&lt;p&gt;The Declarative Pipeline Migration Assistant’s advantages include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Generating a Jenkinsfile from a project for Freestyle.&lt;/li&gt;
&lt;li&gt;A Jenkinsfile customization.&lt;/li&gt;
&lt;li&gt;Creating a Jenkins pipeline project and inserting a Jenkins file.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Generating a Jenkinsfile from a project for Freestyle
&lt;/h3&gt;

&lt;p&gt;A centralized configuration file, called a Jenkinsfile, is the basis for pipeline or multi-branch pipeline projects. In the text editor or GUI, a Jenkinsfile can be generated. The file is maintained either with the project code or, for example, a software configuration management (SCM) tool like Git in a separate repository. Using an SCM to store the file gives the configuration file a centralized location, enables code review and provides an audit trail for the pipeline. To build an initial Jenkinsfile, the Declarative Pipeline Migration Assistant uses information from a Freestyle project.&lt;/p&gt;

&lt;p&gt;The Declarative Pipeline Migration Assistant is only accessible from the Jenkins UI and not from the Jenkins CLI.&lt;/p&gt;

&lt;p&gt;See &lt;a href="https://docs.cloudbees.com/docs/admin-resources/latest/pipelines/defining-pipeline" rel="noopener noreferrer"&gt;Defining Pipeline&lt;/a&gt; for more information about pipelines.&lt;/p&gt;

&lt;p&gt;Prerequisites: Two plugins, namely&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The Pipeline plugins&lt;/li&gt;
&lt;li&gt;The Declarative Pipeline Migration Assistant plugin&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Steps to generate a Jenkinsfile from a Freestyle project-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to the –&amp;gt; &lt;strong&gt;Freestyle project&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;From the Freestyle project tab, choose &lt;strong&gt;To Declarative&lt;/strong&gt; from the left navigation menu.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2FTo-Declarative.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2FTo-Declarative.png" alt="To Declarative"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A Jenkinsfile will be supplied for review once the conversion is complete.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2Fconversion-complete.3736140.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2Fconversion-complete.3736140.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Currently, the Declarative Pipeline Migration Assistant plugin supports a small number of plugins.&lt;br&gt;&lt;br&gt;
It was unable to convert: if the conversion lists a warning for plugins,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The plugin is not compatible with pipelines. You should review the documentation of the plugin to see if it is Pipeline-compatible. Use the shell step as a replacement option if the plugin is not compatible with the pipeline.&lt;/li&gt;
&lt;li&gt;The plugin is compatible with Pipeline and appears in the Snippet Generator. (See table below for a list of compatible plugins.) To construct the correct syntax, use the Snippet Generator.&lt;/li&gt;
&lt;li&gt;The plugin is compatible with the pipeline and will not appear in the Snippet Generator. For more detail on implementing the plugin, refer to the Pipeline documentation; see Customizing a Jenkinsfile.&lt;/li&gt;
&lt;li&gt;You can write plugins for the Declarative Pipeline Migration Assistant for reusability; see Extending the plugin for Declarative Pipeline Migration Assistant.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The table below exhibits a list of the supported plugins.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Type&lt;/td&gt;
&lt;td&gt;Step&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;scm&lt;/td&gt;
&lt;td&gt;git&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;step&lt;/td&gt;
&lt;td&gt;shell step&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;step&lt;/td&gt;
&lt;td&gt;batch step&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;step&lt;/td&gt;
&lt;td&gt;Maven build step&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;build wrapper&lt;/td&gt;
&lt;td&gt;&lt;a href="https://plugins.jenkins.io/config-file-provider/" rel="noopener noreferrer"&gt;Config File Provider plugin&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;build wrapper&lt;/td&gt;
&lt;td&gt;secret (convert to credentials binding)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;build wrapper&lt;/td&gt;
&lt;td&gt;Build a timeout plugin&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;job property&lt;/td&gt;
&lt;td&gt;&lt;a href="https://plugins.jenkins.io/lockable-resources/" rel="noopener noreferrer"&gt;Lockable Resources plugin&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;job property&lt;/td&gt;
&lt;td&gt;build parameters&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;job property&lt;/td&gt;
&lt;td&gt;build discarder configuration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;build trigger&lt;/td&gt;
&lt;td&gt;upstream projects trigger&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;build trigger&lt;/td&gt;
&lt;td&gt;SCM pooling&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;build trigger&lt;/td&gt;
&lt;td&gt;timer trigger&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;build environment&lt;/td&gt;
&lt;td&gt;provide configuration files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;build environment&lt;/td&gt;
&lt;td&gt;use secret text(s) or file(s)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;post-build action&lt;/td&gt;
&lt;td&gt;&lt;a href="https://plugins.jenkins.io/junit/" rel="noopener noreferrer"&gt;JUnit plugin&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;post-build action&lt;/td&gt;
&lt;td&gt;&lt;a href="https://plugins.jenkins.io/htmlpublisher/" rel="noopener noreferrer"&gt;HTML Publisher plugin&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;post-build action&lt;/td&gt;
&lt;td&gt;trigger another project&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;post-build action&lt;/td&gt;
&lt;td&gt;mail notification&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;post-build action&lt;/td&gt;
&lt;td&gt;Do not fail the build if archiving returns nothing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;post-build action&lt;/td&gt;
&lt;td&gt;archive artifacts only if the build is successful&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;post-build action&lt;/td&gt;
&lt;td&gt;fingerprint all archived projects&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;h3&gt;
  
  
  Jenkinsfile Customization
&lt;/h3&gt;

&lt;p&gt;After creating a Jenkinsfile from a Freestyle project, you have few options.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You can either copy-paste the Jenkinsfile into a text file.&lt;/li&gt;
&lt;li&gt;Or you can download the provided text file and open it in the text editor. &lt;/li&gt;
&lt;li&gt;Then, to perform the same tasks performed by the Freestyle project, review the Jenkinsfile and edit as required for the new Pipeline project.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2FJenkinsfile-Customization.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F03%2FJenkinsfile-Customization.png" alt="Jenkinsfile Customization"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Creating a Pipeline Project in Jenkins &amp;amp; Adding a Jenkinsfile
&lt;/h2&gt;

&lt;p&gt;The next move is to add the Jenkinsfile as the configuration file to a Pipeline or Multibranch Pipeline project after creating a Jenkinsfile from a Freestyle project and editing the Jenkinsfile. Creating the Jenkins pipeline project first. Then, by copying and pasting the Jenkinsfile into the Pipeline editor or storing it in an SCM like GitHub and linking the repository to the Pipeline project, add the Jenkinsfile to your project.&lt;/p&gt;

&lt;p&gt;Steps to create a Pipeline project and adding the Jenkinsfile:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; In Jenkins, create a pipeline project and copy and paste the Jenkinsfile text into the editor of the pipeline.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Store the Jenkinsfile in a repository for SCM such as GitHub and:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.cloudbees.com/docs/admin-resources/latest/creating-pipelines/pipeline-in-scm" rel="noopener noreferrer"&gt;Connect the repository to the Jenkins Pipeline project&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;or&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.cloudbees.com/docs/admin-resources/latest/pipelines/pipeline-as-code#_multibranch_pipeline_projects" rel="noopener noreferrer"&gt;Connect the repository to a Multibranch Pipeline project&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Extending the Declarative Pipeline Migration Assistant Plugin&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A small number of plugins are currently supported by the Declarative Pipeline Migration Assistant plugin. For a list of plugins supported, see the table above.&lt;/p&gt;

&lt;p&gt;Beyond this list, if you want to add support for a particular plugin that is currently not supported, it involves attaching the API dependency to the converter and creating the extension.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Adding the API Dependence of the Converter&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The following code snippet is illustrates how to add a dependency on the converter API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;dependency&amp;gt;
      &amp;lt;groupId&amp;gt;org.jenkins-ci.plugins.to-declarative&amp;lt;/groupId&amp;gt;
      &amp;lt;artifactId&amp;gt;declarative-pipeline-migration-assistant-api&amp;lt;/artifactId&amp;gt;
      &amp;lt;version&amp;gt;&amp;lt;/version&amp;gt;
    &amp;lt;/dependency&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Creating the Extension&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The following code snippet is an illustration of how to create the extension:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Extension
public class ShellConverter extends SingleTypedConverter&amp;lt;Shell&amp;gt;
    @Override
    public boolean convert( ConverterRequest request, ConverterResult result, Object target )
    {
      Shell shell = (Shell) target;
      /* Do some work to generate a new stage . . . */
      ModelASTStage stage = new ModelASTStage( this );
      // use a utility method to add the stage to the pipeline model
      ModelASTUtils.addStage( request.getModelASTPipelineDef(), stage);

      // true for success, false for failure
      return true;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Example Conversions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The abstract class SingleTypedConverter&amp;lt;T&amp;gt; defines the extension of the conversion.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;BuilderConverter: convert Builder&lt;/li&gt;
&lt;li&gt;BuildWrapperConverter: convert BuildWrapper&lt;/li&gt;
&lt;li&gt;JobPropertyConverter: convert JobProperty&lt;/li&gt;
&lt;li&gt;PublisherConverter: convert Publisher&lt;/li&gt;
&lt;li&gt;ScmConverter: convert SCM&lt;/li&gt;
&lt;li&gt;TriggerConverter: convert BuildTriggers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example Build Step conversion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The following code snippet is an illustration of how to convert a Shell script Freestyle step using the API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Extension
public class ShellConverter extends SingleTypedConverter&amp;lt;Shell&amp;gt;
{
  @Override
  public boolean convert (ConerterRequest request, ConverterRequest result, Object target )
    {
        Shell shell = (Shell) target;
        ModelASTStage stage = new ModelASTStage( this );
        int stageNumber = request.getAndIncrement( SHELL_NUMBER_KEY );  
        stage.setName( "Shell script " + stageNumber );
        ModelASTBranch branch = new ModelASTBranch( this );  
        stage.setBranches( Arrays.asList( branch ) );  
        ModelASTStep step = new ModelASTStep( this );  
        step.setName( "sh" );  
        ModelASTSingleArgument singleArgument = new ModelASTSingleArgument( this );
        singleArgument.setValue( ModelASTValue.fromConstant( shell.getCommand(), this ) ); 
        step.setArgs( singleArgument );
        ModelASTUtils.wrapBranch(result, step, branch); 
        ModelASTUtils.addStage(result.getModelASTPipelineDef(), stage); 
        return true;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Example Build Wrapper Conversion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The following example converts the Config File Freestyle wrapper build using the API. This conversion uses a helper method to add a wrapper around all future build step conversions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// This was to not have the config-file-provider plugin as a required dependency
// But you can use (as you use your plugin)
@OptionalExtension(requirePlugins = { "config-file-provider" })
public class ConfigFileBuildWrapperConverter extends SingleTypedConverter&amp;lt;ConfigFileBuildWrapper&amp;gt;
{
    private Logger LOGGER = LoggerFactory.getLogger( ConfigFileBuildWrapperConverter.class );

    @Override
    public boolean convert(ConverterRequest request, ConverterResult result, Object target)
    {
        ConfigFileBuildWrapper configFileBuildWrapper = (ConfigFileBuildWrapper) target;
        if(configFileBuildWrapper.getManagedFiles() == null || configFileBuildWrapper.getManagedFiles().isEmpty() )
        {
            return true;
        }

        result.addWrappingTreeStep( () -&amp;gt; build( configFileBuildWrapper) ); 
        return true;
    }

    private ModelASTTreeStep build(ConfigFileBuildWrapper configFileBuildWrapper) {
        ModelASTTreeStep configFileProvider = new ModelASTTreeStep( this );

        configFileProvider.setName( "configFileProvider" );
        ModelASTSingleArgument singleArgument = new ModelASTSingleArgument( null );
        configFileProvider.setArgs( singleArgument );

        ManagedFile managedFile = configFileBuildWrapper.getManagedFiles().get( 0 ); 
        StringBuilder gstring = new StringBuilder( "[configFile(fileId:'" );
        gstring.append( managedFile.getFileId());
        gstring.append( "', targetLocation: '" );
        gstring.append( managedFile.getTargetLocation() );
        gstring.append( "')]" );
        singleArgument.setValue( ModelASTValue.fromGString( gstring.toString(), this ) );
        return configFileProvider;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Example Publisher Conversion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The following example converts the ArtifactArchiver Freestyle post-build step using the API. This conversion modifies the model to add some build conditions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Extension
public class ArtifactArchiverConverter extends SingleTypedConverter&amp;lt;ArtifactArchiver&amp;gt; {
    @Override
    public boolean convert(ConverterRequest request, ConverterResult result, Object target) {
        ArtifactArchiver artifactArchiver = (ArtifactArchiver) target;
        ModelASTBuildCondition buildCondition;
        if(artifactArchiver.isOnlyIfSuccessful()) { 
            buildCondition = ModelASTUtils.buildOrFindBuildCondition( result.getModelASTPipelineDef(), "success" );
        } else {
            buildCondition = ModelASTUtils.buildOrFindBuildCondition( result.getModelASTPipelineDef(), "always" );
        }
        ModelASTStep archiveArtifacts = ModelASTUtils.buildGenericStep(artifactArchiver, this);
        ModelASTUtils.addStep(buildCondition, archiveArtifacts); 
        return true;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Depending on which condition the artifact needs to be executed, we add the step to the build condition.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example SCM Conversion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The following example converts the Git SCM Freestyle stage using the API. This conversion adds a stage to the Pipeline model.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@OptionalExtension(requirePlugins = { "git"})
public class GitScmConverter extends SingleTypedConverter&amp;lt;GitSCM&amp;gt;
{
  @Override
  public boolean convert(ConverterRequest request, ConverterResult result, Object target)
    {
        List&amp;lt;UserRemoteConfig&amp;gt; repoList = ( (GitSCM) target ).getUserRemoteConfigs();
        if(repoList.isEmpty()){
            return true;
        }
        ModelASTStage stage = new ModelASTStage( this ); 
        stage.setName( "Checkout Scm" );
        List&amp;lt;ModelASTStep&amp;gt; steps = new ArrayList&amp;lt;&amp;gt;(); 
        // a step will be created per remote repository
        for( UserRemoteConfig userRemoteConfig : repoList) 
        {
            ModelASTStep git = new ModelASTStep( null ); 
            git.setName( "git" );

            Map&amp;lt;ModelASTKey, ModelASTValue&amp;gt; args = new HashMap&amp;lt;&amp;gt;();
            {
                ModelASTKey url = new ModelASTKey( this ); 
                url.setKey( "url" );
                ModelASTValue urlValue = ModelASTValue.fromConstant( userRemoteConfig.getUrl(), this );
                args.put( url, urlValue );
            } 

            ...

            ModelASTNamedArgumentList stepArgs = new ModelASTNamedArgumentList( null);  
            stepArgs.setArguments( args );
            git.setArgs( stepArgs );
            steps.add( git );
        }

        ModelASTBranch branch = new ModelASTBranch( this ); 
        branch.setSteps(steps);
        stage.setBranches( Arrays.asList( branch ) );
        ModelASTUtils.addStage(result.getModelASTPipelineDef(), stage ); 
        return true;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Create a new stage.&lt;/li&gt;
&lt;li&gt;Steps will be generated as: – git url: “”, branch: ”,changelog: ”, credentialsId: ”, pool: ”&lt;/li&gt;
&lt;li&gt;A step is created based on each remote repository.&lt;/li&gt;
&lt;li&gt;Create the Git step.&lt;/li&gt;
&lt;li&gt;Add parameters – URL.&lt;/li&gt;
&lt;li&gt;In the original code, add more parameters.&lt;/li&gt;
&lt;li&gt;Configure args of the step.&lt;/li&gt;
&lt;li&gt;Create a branch for the stage.&lt;/li&gt;
&lt;li&gt;Use a utility method to add the stage to the Pipeline model.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Example Build Trigger Conversion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Using the API, the following example transforms the cron trigger. The pipeline mode is changed by this conversion to add a trigger property through a utility process.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Extension
public class TimerTriggerConverter extends SingleTypedConverter&amp;lt;TimerTrigger&amp;gt;
{
    @Override
    public boolean convert(ConverterRequest request, ConverterResult result, Object target)
    {
        TimerTrigger timerTrigger = (TimerTrigger) target;

        String cronValue = timerTrigger.getSpec();
        ModelASTTrigger modelASTTrigger = new ModelASTTrigger( this ); 
        modelASTTrigger.setName( "cron" );
        modelASTTrigger.setArgs( Arrays.asList(ModelASTValue.fromConstant( cronValue, this )) );

        ModelASTUtils.addTrigger( result.getModelASTPipelineDef(), modelASTTrigger );  
        return true;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s how you can create your very own pipeline projects!&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping Up!
&lt;/h2&gt;

&lt;p&gt;In this blog, we saw the central feature of &lt;a href="https://www.lambdatest.com/learning-hub/jenkins?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Piyusha-20052021&amp;amp;utm_term=Piyusha" rel="noopener noreferrer"&gt;Jenkins&lt;/a&gt; learning how to create a job in Jenkins, Jenkins build job and creating pipeline projects. Through the Jenkins freestyle project, you can build your project, combine any SCM with any build system. We also saw a few extensions of Freestyle projects like the docker container images. The conversion of freestyle projects into Declarative Pipelines offers a more modern and suggested solution.&lt;/p&gt;

&lt;p&gt;Let us know what you feel about this blog in the comments below. Try reproducing the steps for Jenkins to create and build a job to learn on the go.&lt;/p&gt;

&lt;p&gt;Happy testing!&lt;/p&gt;

</description>
      <category>jenkins</category>
      <category>automation</category>
      <category>testing</category>
    </item>
    <item>
      <title>How To Integrate Cucumber With Jenkins?</title>
      <dc:creator>Piyusha</dc:creator>
      <pubDate>Mon, 05 Apr 2021 07:38:40 +0000</pubDate>
      <link>https://forem.com/piyusha/how-to-integrate-cucumber-with-jenkins-5326</link>
      <guid>https://forem.com/piyusha/how-to-integrate-cucumber-with-jenkins-5326</guid>
      <description>&lt;p&gt;Cucumber is an open-source BDD (Behavior-Driven Development) testing tool for automation testing of web applications. It remains to be one of the best frameworks for functional and acceptance testing. This is because of its widespread adoption in the open-source community, enhanced natural language support, and the ability to support new programming languages quickly. Almost all organizations that use &lt;a href="https://www.lambdatest.com/selenium?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Piyusha-5042021&amp;amp;utm_term=Piyusha" rel="noopener noreferrer"&gt;Selenium&lt;/a&gt; prefer to integrate Selenium with Cucumber since Cucumber makes it easy to read and understand the application flow. To schedule test case executions remotely, we can also go for Cucumber with Jenkins integration and utilize the immense benefits of Jenkins.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started with Cucumber Jenkins Setup
&lt;/h2&gt;

&lt;p&gt;Cucumber is well-known for agile development of web applications and reporting the results. With an easy-to-understand language, powerful plugins, and a straightforward integration with Selenium, starting Cucumber with Jenkins integration has never been easier.&lt;/p&gt;

&lt;p&gt;Before we begin, let’s understand why you need Cucumber with Jenkins integration in the first place. Here’s why- Cucumber acts as a bridge between:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Manual Tester and Developers.&lt;/li&gt;
&lt;li&gt;Software Engineer and Business Analyst.&lt;/li&gt;
&lt;li&gt;Manual Tester and Automation Tester.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And as you already know, Jenkins is an open-source, accessible, easy to use CI/CD tool. With Jenkins, you can schedule a run on scheduled time or trigger builds after an event, and it also comes with a plethora of plugins. You can refer to our comprehensive &lt;a href="https://www.lambdatest.com/learning-hub/jenkins?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Piyusha-5042021&amp;amp;utm_term=Piyusha" rel="noopener noreferrer"&gt;Jenkins tutorial&lt;/a&gt; to learn more about this tool.&lt;/p&gt;

&lt;p&gt;Now, let us see how to integrate Cucumber with Jenkins.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites for Cucumber with Jenkins Integration&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We need the installation of the below plugins to start Cucumber with Jenkins integration. Let us see an overview and utilities of the below plugins. This section will see how to make use of some Jenkins plugins that work together with Cucumber formatting outputs.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Cucumber Test Results plugin&lt;/li&gt;
&lt;li&gt;Cucumber Reports&lt;/li&gt;
&lt;li&gt;Cucumber perf plugin&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  A. Cucumber Test Results plugin
&lt;/h3&gt;

&lt;p&gt;This plugin takes Cucumber JSON output as input and publishes the results in polychrome. The results will appear in GREEN when they have passed and RED when they fail.&lt;/p&gt;

&lt;p&gt;Here’s how to install the Cucumber Test Results plugin. You can also refer to our blog on generating TestNG reports in Jenkins for more information.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Login to your Jenkins server as an administrator.&lt;/li&gt;
&lt;li&gt;Navigate to “ &lt;strong&gt;Manage Jenkins&lt;/strong&gt;.” &lt;/li&gt;
&lt;li&gt;Go ahead and click “ &lt;strong&gt;Manage Plugins&lt;/strong&gt;.”&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FManage-Plugins-1024x481.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FManage-Plugins-1024x481.png" alt="Manage Plugins"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to the “ &lt;strong&gt;Available&lt;/strong&gt; ” tab under the manage plugins page.&lt;/li&gt;
&lt;li&gt;Search for “ &lt;strong&gt;cucumber&lt;/strong&gt; ” in the filter at the right top corner. &lt;/li&gt;
&lt;li&gt;Go ahead and check the box against the &lt;strong&gt;Cucumber reports&lt;/strong&gt;. &lt;/li&gt;
&lt;li&gt;Choose “ &lt;strong&gt;Install without restart&lt;/strong&gt; ” to start the installation.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FInstall-without-restart-1024x466.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FInstall-without-restart-1024x466.png" alt="Install without restart"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FCucumber-Jenkins-3-1024x465.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FCucumber-Jenkins-3-1024x465.png" alt="Cucumber Jenkins 3"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click “ &lt;strong&gt;Back to dashboard&lt;/strong&gt; ” in the left menu &lt;/li&gt;
&lt;li&gt;Navigate to the &lt;strong&gt;job&lt;/strong&gt; already created. ‘Cucumber’ in our case.&lt;/li&gt;
&lt;li&gt;Click “ &lt;strong&gt;Configure&lt;/strong&gt; ” against the job. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FCucumber-Jenkins-4-1024x464.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FCucumber-Jenkins-4-1024x464.png" alt="Cucumber Jenkins"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Scroll down to &lt;strong&gt;Post-Build Actions&lt;/strong&gt;. Under “ &lt;strong&gt;Add post-build action&lt;/strong&gt; ,” select “ Cucumber reports.”&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FAdd-post-build-action-1024x472.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FAdd-post-build-action-1024x472.png" alt="Add post-build action"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click on &lt;strong&gt;Advanced&lt;/strong&gt;. Go to &lt;strong&gt;Post-build Actions&lt;/strong&gt;. Add below report file in the text box as shown. You can Ignore the message at the bottom. It appears since we don’t have any files yet, once we run the build, they will be created.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FPost-build-Actions.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FPost-build-Actions.png" alt="Post-build Actions"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The next step is to generate Cucumber JSON reports. &lt;/li&gt;
&lt;li&gt;Open the &lt;strong&gt;cucumber.yml&lt;/strong&gt; file in your page-object_framework and add the below-highlighted string. &lt;/li&gt;
&lt;li&gt;This is to make sure we have reports.json output in addition to the HTML reports. The cucumber plugin will parse these on Jenkins.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2Fcucumber_yml_json.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2Fcucumber_yml_json.png" alt="cucumber_yml_json"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Execution&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To execute, click the “ &lt;strong&gt;Build Now&lt;/strong&gt; ” button from the left menu for the job. The build should be successful. Instead of watching console output, select “ &lt;strong&gt;Cucumber Test Result&lt;/strong&gt; ” at the end of the build.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2Fresults_output.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2Fresults_output.png" alt="results_output"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Results&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Next, go to &lt;strong&gt;Feature –&amp;gt; Scenario&lt;/strong&gt; , where you can see all the steps’ status. As shown below, they are all GREEN.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2Ffinal_results.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2Ffinal_results.png" alt="Test Results"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  B. Cucumber Reports
&lt;/h3&gt;

&lt;p&gt;Cucumber Reports plugin can read the JSON output and produce pie charts for feature or scenario results &amp;amp; bar graphs for tags. This is possible if we had options “-f json -out cucumber.json,” where you output the results to JSON format, i.e., in cucumber.yml. This plugin has advanced options to help us make vital decisions on the test results.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Add a post-build step and select the “ &lt;strong&gt;Publish cucumber results as a report&lt;/strong&gt; ” option, as shown below.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2Fcucumber_reports.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2Fcucumber_reports.png" alt="cucumber_reports"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Referring to the job, the below menu option will be visible to us as below.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2Fcucumber_reports_piecharts.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2Fcucumber_reports_piecharts.png" alt="Cucumber Menu Option"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Next, run the job and click the reports. The reports will be in the form of SWF charts, as shown below.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2Fcucumber_reports_piecharts_failed-1024x523.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2Fcucumber_reports_piecharts_failed-1024x523.png" alt="cucumber_reports_piecharts_failed"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Results&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We get results as below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2Fcucumber_reports_piecharts_features-1024x468.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2Fcucumber_reports_piecharts_features-1024x468.png" alt="Test Results"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  C. Cucumber perf plugin
&lt;/h3&gt;

&lt;p&gt;This plugin helps us demonstrate the history of how Cucumber results were performing as a trend. This is helpful when you keep running the suite multiple times.&lt;/p&gt;

&lt;p&gt;There are additional features to it, like “ &lt;strong&gt;worst-performing features&lt;/strong&gt; ” over time. This mainly helps us focus on those bottlenecks and allows us to debug them further.&lt;/p&gt;

&lt;h2&gt;
  
  
  Integrating Cucumber with Jenkins
&lt;/h2&gt;

&lt;p&gt;Now, you are all set with the prerequisites for Cucumber with Jenkins integration. In this section, we will see how to integrate Cucumber with Jenkins using these plugins. In case you haven’t installed them yet, let us start from the very beginning-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Access Jenkins URL. The default is port 8080.&lt;/li&gt;
&lt;li&gt;Go to “ &lt;strong&gt;Manage Jenkins&lt;/strong&gt; ” –&amp;gt; “ &lt;strong&gt;Manage Plugins&lt;/strong&gt;.”&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2Fpasted-image-0-12.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2Fpasted-image-0-12.png" alt="Welcome to Jenkins"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2Fpasted-image-0-1-3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2Fpasted-image-0-1-3.png" alt="Manage Jenkins"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install the following plugins

&lt;ul&gt;
&lt;li&gt;Cucumber Test Results plugin&lt;/li&gt;
&lt;li&gt;Cucumber Reports&lt;/li&gt;
&lt;li&gt;Cucumber perf plugin&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Make sure while installing these plugins, all the dependent plugins are also successfully installed. This is to ensure the plugins work as expected without glitches.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FSelectPlugin.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FSelectPlugin.jpg" alt="SelectPlugin"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The next step is to navigate to “ &lt;strong&gt;Manage&lt;/strong&gt; ” –&amp;gt; “ &lt;strong&gt;Global Tool Configuration&lt;/strong&gt;.” Under “ &lt;strong&gt;JDK&lt;/strong&gt; ,” set the path for JDK.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FJDK.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FJDK.jpg" alt="JDK Installation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Under “ &lt;strong&gt;Maven&lt;/strong&gt; ,” set the path for Maven.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FMaven.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FMaven.jpg" alt="Maven"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a “ &lt;strong&gt;New Item&lt;/strong&gt; ” as a Maven Project as shown below. Enter any arbitrary name.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2Fpasted-image-0-2-3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2Fpasted-image-0-2-3.png" alt="Create New Job Jenkins"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FJobName.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FJobName.jpg" alt="JobName"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Once the job is created, click on the “ &lt;strong&gt;Configure&lt;/strong&gt; ” link on the left-hand side panel.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FConfigure.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FConfigure.jpg" alt="Configure Cucumber Project"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Scroll down the page. Set the full path of pom.xml under “ &lt;strong&gt;Root POM&lt;/strong&gt; ” and “Goal and options” as ‘test’ and proceed to save the configuration.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FBuild.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FBuild.jpg" alt="Setting Path in Pom xml"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Once all the above steps are completed, click on the “ &lt;strong&gt;Build Now&lt;/strong&gt; ” button.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FBuildnow.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FBuildnow.jpg" alt="Buildnow"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The build will be executed, and the corresponding testing.xml file, which is the pom.xml, will get executed.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[INFO] T E S T S
[INFO] ——————————————————-
[INFO] Running TestSuite
New scenario begins
Starting ChromeDriver 2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f) on port 27348
Only local connections are allowed.
(org.apache.http.client.protocol.RequestAddCookies).
Feb 02, 2021 09:49:41 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
https://avatars3.githubusercontent.com/u/31874017?s=400&amp;amp;u=c41bfae0fa6b9325fb4f209885b51bd02c7d897d&amp;amp;v=4
https://avatars3.githubusercontent.com/u/31874017?s=400&amp;amp;u=c41bfae0fa6b9325fb4f209885b51bd02c7d897d&amp;amp;v=4
Scenario ends
New scenario begins
Starting ChromeDriver 2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f) on port 24866
Only local connections are allowed.
Feb 02, 2021 09:50:47 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
Scenario ends
2 Scenarios (2 passed)
14 Steps (14 passed)
2m2.677s

[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 128.513 s – in TestSuite
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[JENKINS] Recording test results
[INFO] ————————————————————————
[INFO] BUILD SUCCESS
[INFO] ————————————————————————
[INFO] Total time: 02:04 min
[INFO] Finished at: 2021-02-02T09:51:45+05:30
[INFO] Final Memory: 12M/28M
[INFO] ————————————————————————
Waiting for Jenkins to finish collecting data
[JENKINS] Archiving D:\cucumberFinal\multiple\pom.xml to com/cucumber.example/0.0.1-SNAPSHOT/cucumber.example-0.0.1-SNAPSHOT.pom
channel stopped
Finished: SUCCESS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hurray, you have successfully completed Cucumber with Jenkins integration! Before we proceed further, this might be the right time to acquaint yourself with the &lt;a href="https://www.lambdatest.com/blog/cucumber-best-practices/?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Piyusha-5042021&amp;amp;utm_term=Piyusha" rel="noopener noreferrer"&gt;best Cucumber practices&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Running Cucumber Script with Jenkins
&lt;/h2&gt;

&lt;p&gt;Automation scripts built with the Cucumber framework benefit from being easy to understand, easy to communicate, and good maintenance, so it is popular among test automation teams. An essential aspect of integrating DevOps is incorporating automated testing into a continuous integration (CI) process.&lt;/p&gt;

&lt;p&gt;Now that you have completed the Cucumber Jenkins setup, in this section, we will see how to configure Jenkins to run an automated Cucumber test script and show the Jenkins UI report. This can be done using the following methods-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Cucumber’s Command Line Mode&lt;/li&gt;
&lt;li&gt;CukeTest’s Command Line Mode&lt;/li&gt;
&lt;li&gt;Jenkins Continuous Integration Configuration&lt;/li&gt;
&lt;li&gt;Jenkins Test Report Plugin Configuration &lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Cucumber’s Command Line Mode
&lt;/h3&gt;

&lt;p&gt;To illustrate the Cucumber Command Line, we use Cucumber.js. Many who already know this tool know that it means running the “Cucumber-js” command directly in the directory of the automation script. Or if you don’t have Cucumber installed globally, run “node modules/.bin/cucumber-js” (or, if you’re on Windows, the .cmd extension), and the Cucumber installed locally will be used. After execution, the output of the text on the command line is written. You can refer to our &lt;a href="https://www.lambdatest.com/blog/cucumberjs-tutorial-selenium/?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Piyusha-5042021&amp;amp;utm_term=Piyusha" rel="noopener noreferrer"&gt;Cucumber.js tutorial&lt;/a&gt; for more information.&lt;/p&gt;

&lt;p&gt;The command line is identical if you are running it as a job under Jenkins. Just add the “format” parameter, indicating the output file in the “JSON” format, to make Jenkins render a visual report. The following is the command line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node_modules\.bin\cucumber-js --format json:report.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A report is output to report.json, and then this file is used by the Jenkins job to view the report.&lt;/p&gt;

&lt;h3&gt;
  
  
  CukeTest’s Command Line Mode
&lt;/h3&gt;

&lt;p&gt;CukeTest is Cucumber.js’s development tool. These editions support command line mode and are available on Windows Desktop, Windows Store, MacOS, etc. It is available for free at CukeTest’s official website. CukeTest is used to build scripts for Cucumber.js and can also be used to execute scripts for Cucumber.js from the command line.&lt;/p&gt;

&lt;p&gt;The benefit of using CukeTest is that with each project, you don’t have to install Cucumber.js. CukeTest already has Cucumber.js built-in, which saves your storage space and time. Another advantage is that it can run Windows automation with the library built-in, capture video, etc.&lt;/p&gt;

&lt;p&gt;The Windows Store version of CukeTest has a different command line process, so the command line varies slightly from the desktop version. Luckily, you don’t need to recall all the specifics of the command line.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In CukeTest, you can open a run profile when your project is opened to get the command line by clicking the drop-down arrow next to the “ &lt;strong&gt;Run Project&lt;/strong&gt; ” button and then clicking “ &lt;strong&gt;Edit Profiles&lt;/strong&gt;.”&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FB9vFp2A5TbaLAv8kBpvO.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FB9vFp2A5TbaLAv8kBpvO.png" alt="CukeTest"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In the “ &lt;strong&gt;Run Profile&lt;/strong&gt; s” dialogue, the corresponding command line is automatically created for this profile in the command line:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FRun-Profiles.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FRun-Profiles.png" alt="Run Profiles"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click the “ &lt;strong&gt;Copy to clipboard&lt;/strong&gt; ” option to copy the commands to the clipboard. &lt;/li&gt;
&lt;li&gt;Then click the “ &lt;strong&gt;Open console window&lt;/strong&gt; ” option, and paste the command line to this newly opened window.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Below are the command lines for various platforms-&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Command line for Windows Store version
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chcp 65001 &amp;amp;&amp;amp; start cuketest://?profile=Profile1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;CukeTest’s command line output is encoded in UFT8. So using the command “chcp 65001” helps change the command line encoding from UFT8 to UTF8.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;CukeTest desktop version
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chcp 65001 &amp;amp;&amp;amp; cuke --run --format html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;CukeTest’s command line output is encoded in UFT8. So using the command “chcp 65001” helps change the command line encoding from UFT8 to UTF8.&lt;/p&gt;

&lt;h3&gt;
  
  
  Jenkins Continuous Integration Configuration
&lt;/h3&gt;

&lt;p&gt;Once we are aware of the steps to run the project in the command line, we can configure Jenkins to run it. Below are the steps to configure the Jenkins job.&lt;/p&gt;

&lt;p&gt;For the demo, the source code is kept in &lt;a href="https://github.com/CnodejsTest" rel="noopener noreferrer"&gt;https://github.com/CnodejsTest&lt;/a&gt;. This project is used to automate test cnodejs.org community site. Alternatively, we can use our Cucumber project to configure and run the job.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a new job in Jenkins. Enter any arbitrary name.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2Fw9oElTEzQA65383FPsQe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2Fw9oElTEzQA65383FPsQe.png" alt="Create new job in Jenkins"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In the item bar, select “ &lt;strong&gt;Windows Batch Command&lt;/strong&gt;.” Here we have to copy &amp;amp; paste the corresponding command line from CukeTest to the Jenkins batch command box. In case you have a CukeTest desktop version installed natively, below is your command line.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install
chcp 65001 &amp;amp;&amp;amp; cuke --run --format html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The ‘ &lt;strong&gt;npm install&lt;/strong&gt; ’ command installs npm dependency packages that are consumed by the automation script.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Perform the below job configuration UI with the commands as entered below.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2Fnpm-start.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2Fnpm-start.png" alt="npm start"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Save this project configuration by clicking ‘ &lt;strong&gt;Save&lt;/strong&gt;.’ Now click the “ &lt;strong&gt;Build Now&lt;/strong&gt; ” button, and the project will then start executing.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can observe the execution progress upon build now of the job in the build history.&lt;/p&gt;

&lt;p&gt;We can also find the running job log under the Build History. At the exact moment, the report file is also generated in the Jenkins Workspace directory.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The next step is to configure the Jenkins job to show the Jenkins interface test report. This can be done quickly using the Plugin we just saw in the previous section to format and display the test report.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Jenkins Test Report Plugin Configuration
&lt;/h3&gt;

&lt;p&gt;In Jenkins, we can use the Cucumber reports plugin to show the report. We have already seen the introduction to this plugin in the Cucumber Jenkins setup above. Additionally, you can also read the information about this Plugin available at the official &lt;a href="https://wiki.jenkins.io/display/JENKINS/Cucumber+Reports+Plugin" rel="noopener noreferrer"&gt;Jenkins website&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;The following are the steps to configure Jenkins to generate reports.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install the Jenkins reports plugin&lt;/strong&gt;
Open &lt;strong&gt;Jenkins&lt;/strong&gt; –&amp;gt; &lt;strong&gt;Manage Plugin&lt;/strong&gt; –&amp;gt; Filter “ &lt;strong&gt;Cucumber reports&lt;/strong&gt; ” in Optional Plugin.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2Fjenkins.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2Fjenkins.png" alt="Install the Jenkins reports plugin"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We need to restart Jenkins after the installation of this plugin.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Reconfigure the Jenkins task&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We need JSON log data files to generate reports because the Cucumber reports Plugin generates reports by parsing the JSON report file created by Cucumber or CukeTest. Therefore, it is necessary that we first configure a running project which will create JSON log data files.&lt;/p&gt;

&lt;p&gt;In the run configuration file, we have to select “ &lt;strong&gt;JSON&lt;/strong&gt; ” in the report format.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FJSON.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FJSON.png" alt="JSON"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When we would run this command, the command line execution output is changed to json.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Display the Cucumber reports&lt;/strong&gt;
In the ‘ &lt;strong&gt;Add post-build operation&lt;/strong&gt; ’ action, select the ‘ &lt;strong&gt;Cucumber reports&lt;/strong&gt; ’ option.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FCucumber-reports.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FCucumber-reports.png" alt="Cucumber reports"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Go to the ‘ &lt;strong&gt;Advanced&lt;/strong&gt; ’ option under the ‘ &lt;strong&gt;Cucumber reports&lt;/strong&gt;.’ In the ‘JSON Reports Path,’ enter “reports.”&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FntoVz4X1Rmi2eqSZKdpI.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FntoVz4X1Rmi2eqSZKdpI.png" alt="JSON report location"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Save&lt;/strong&gt; to finish the project configuration.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Generating test report&lt;/strong&gt;
To generate the test report, we have to click the “ &lt;strong&gt;Build Now&lt;/strong&gt; ” button. After the job is completed, a test report will be generated automatically. Besides, the test report provides us with a link to each scenario, where each link, when clicked, shows the details of the scenarios. The report also indicates the screenshot captured in each scenario step or hooks along with each step’s execution result.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2Fpasted-image-0-3-3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2Fpasted-image-0-3-3.png" alt="Generating test report"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So till now, what we have seen is how to integrate Cucumber with Jenkins and how to run a Cucumber script on Jenkins along with the generation of graphical reports.&lt;/p&gt;

&lt;p&gt;It is also possible to leverage cloud-based platforms’ automation capability to make remote testing more seamless than ever. You can configure your Cucumber scripts to run on LambdaTest’s &lt;a href="https://www.lambdatest.com/selenium-automation?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Piyusha-5042021&amp;amp;utm_term=Piyusha" rel="noopener noreferrer"&gt;Selenium Grid cloud&lt;/a&gt; and perform testing on 2000+ browsers, devices &amp;amp; operating systems. In the next section, we will learn how you can make the most of Cucumber with Jenkins integration &amp;amp; LambdaTest.&lt;/p&gt;

&lt;h2&gt;
  
  
  Leveraging Cucumber Jenkins Setup with LambdaTest Cloud Selenium Grid
&lt;/h2&gt;

&lt;p&gt;Below we would see how we can get our Cucumber scripts running on the LambdaTest platform, and further, we can use the same steps as defined above to integrate Jenkins to generate the reports.&lt;/p&gt;

&lt;p&gt;Few prerequisites before we start running the scripts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It is assumed that Java is installed on the machine. Preferably JDK 8 and above.&lt;/li&gt;
&lt;li&gt;Also, it is assumed we have node.js installed. If not, you can easily install it from &lt;a href="https://nodejs.org/en/." rel="noopener noreferrer"&gt;https://nodejs.org/en/.&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Your LambdaTest credentials should be set as environment variables.

&lt;ul&gt;
&lt;li&gt;If you are a Windows user, set them as set LT_USERNAME=”YOUR_USERNAME”&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;set LT_ACCESS_KEY=”YOUR ACCESS KEY”&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you are a Mac user, set them as export LT_USERNAME=”YOUR_USERNAME”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;export LT_ACCESS_KEY=”YOUR ACCESS KEY”&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In case you are unaware of the access key, you can easily retrieve them from your &lt;a href="https://accounts.lambdatest.com/dashboard" rel="noopener noreferrer"&gt;LambdaTest dashboard&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FLT-dashboard-1024x474.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2FLT-dashboard-1024x474.png" alt="LT dashboard"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We also have to update .conf.js files inside the conf/ directory with these credentials.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After we have the environment setup aligned, perform the below steps to run the Cucumber scripts.&lt;br&gt;&lt;br&gt;
Make sure we have our repository cloned from Git.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In case it is the first time you are running a script for a repository hosted on Git, you can clone a sample repository provided by LambdaTest, which is &lt;a href="https://github.com/LambdaTest/NodeJs-Cucumber-Selenium.git" rel="noopener noreferrer"&gt;NodeJs-Cucumber-Selenium&lt;/a&gt; from GitHub.&lt;/li&gt;
&lt;li&gt;Navigate to the cloned directory and install the project dependencies using the below command.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;$ npm install&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to karma-jasmine-sample and run &lt;code&gt;$ npm run single&lt;/code&gt; to run the test in single or &lt;code&gt;$ npm run parallel&lt;/code&gt; to run the test in parallel.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both the commands validate the test cases and execute the test suite across all the defined test groups. We can check the test results by opening the LambdaTest platform and navigating to the &lt;a href="https://automation.lambdatest.com/" rel="noopener noreferrer"&gt;Automation dashboard&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The below sample snippet depicts the same.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2Fsample-screenshot.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.lambdatest.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2Fsample-screenshot.jpg" alt="sample-screenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This blog presents how a Cucumber with Jenkins integration can help run automation scripts successfully. Additionally, this Cucumber with Jenkins integration can also be leveraged to run scripts over the LambdaTest cloud platform. The best part is that project stakeholders can all read the test reports after the Cucumber Jenkins setup and understand the quality status. Jenkins also has many other features, such as setting up timed service, sending mail, and other functions. You can configure to further customize report notification according to project needs, such as sending HTML reports to key stakeholders as an email.&lt;/p&gt;

&lt;p&gt;Do leave your comments if you found this blog helpful. If you have any questions or doubts, you can always shoot up your query on &lt;a href="https://community.lambdatest.com/?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Piyusha-5042021&amp;amp;utm_term=Piyusha" rel="noopener noreferrer"&gt;LambdaTest Community&lt;/a&gt; and get it resolved!&lt;/p&gt;

&lt;p&gt;Happy testing!&lt;/p&gt;

</description>
      <category>jenkins</category>
      <category>cucumber</category>
      <category>devops</category>
      <category>selenium</category>
    </item>
    <item>
      <title>How To Generate TestNG Reports In Jenkins?</title>
      <dc:creator>Piyusha</dc:creator>
      <pubDate>Wed, 24 Mar 2021 10:32:38 +0000</pubDate>
      <link>https://forem.com/piyusha/how-to-generate-testng-reports-in-jenkins-572</link>
      <guid>https://forem.com/piyusha/how-to-generate-testng-reports-in-jenkins-572</guid>
      <description>&lt;p&gt;TestNG is an open-source automated testing framework, where ‘NG’ of TestNG is Next Generation. It is similar to JUnit but designed to be better than JUnit, especially when testing integrated classes. With the help of simple annotations, grouping, sequencing &amp;amp; parametrization, TestNG overcomes most of the older system’s limitations and gives the developer the ability to write more versatile and efficient tests.&lt;/p&gt;

&lt;p&gt;In our previous blogs, we have seen how to run tests in TestNG using an XML file, Parameterisation in TestNG, TestNG listeners, and much more. In this blog, we will find out how to generate a TestNG report in Jenkins. This will be particularly useful if you are into &lt;a href="https://www.lambdatest.com/selenium-automation?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Piyusha-24032021&amp;amp;utm_term=Piyusha"&gt;Selenium test automation&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Use TestNG in the First Place?
&lt;/h2&gt;

&lt;p&gt;TestNG is quite popular among developers and testers for test creation. It offers several practical features like grouping, dependence, prioritization, ease of using multiple annotations, etc. If you are not a fan of TestNG, allow me to introduce you to a few of the several benefits offered by it, especially from &lt;a href="https://lambdatest.com/selenium?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Piyusha-24032021&amp;amp;utm_term=Piyusha"&gt;Selenium&lt;/a&gt; perspective-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It supports annotations.&lt;/li&gt;
&lt;li&gt;It has a flexible test configuration, ensuring that the code is multithread safe.&lt;/li&gt;
&lt;li&gt;Support for data-driven testing (with @DataProvider).&lt;/li&gt;
&lt;li&gt;Support for parameters.&lt;/li&gt;
&lt;li&gt;No more need for TestSuite and accompanies a powerful execution model.&lt;/li&gt;
&lt;li&gt;Supports a variety of tools and plugins, which include Jenkins, Eclipse, Maven, etc.&lt;/li&gt;
&lt;li&gt;Embeds BeanShell for further flexibility.&lt;/li&gt;
&lt;li&gt;It is designed to cover tests (almost all): Unit tests, Functional tests, End-to-end tests, Integration tests, etc.&lt;/li&gt;
&lt;li&gt;It uses more Java and OO concepts and features.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Importance of TestNG Annotations
&lt;/h3&gt;

&lt;p&gt;Primarily, developers use annotation repeatedly to define a piece of code that is incorporated into the software or business logic used in the programming language Java to control the flow of methods. In Test Next Generation (TestNG), annotations play a significant role. When working on TestNG, testers need to consider the operations and uses of each annotation.&lt;/p&gt;

&lt;p&gt;Although Annotations differ from project to project depending on their requirements, the execution flow remains intact for every single project. Below are different Annotations present in TestNG and their primary usage:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;@BeforeSuite:&lt;/strong&gt; The annotated method will run before all tests in this suite have run.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;@AfterSuite:&lt;/strong&gt; The annotated method will run after all tests in this suite have run.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;@AfterTest:&lt;/strong&gt; The annotated method will run after all the test methods belonging to the classes inside the tag have run.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;@BeforeTest:&lt;/strong&gt; The annotated method will run before any test method belonging to the classes inside the tag has run.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;@AfterGroups:&lt;/strong&gt; The annotated method is a list of groups that the configuration method will run after. This method will run shortly after invoking the last test method that belongs to any of these groups.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;@BeforeGroups:&lt;/strong&gt; The annotated method is a list of groups that the configuration method will run before. This method will run shortly before invoking the first test method that belongs to any of these groups.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;@AfterClass:&lt;/strong&gt; The annotated method will run after all the current class test methods have been run.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;@BeforeClass:&lt;/strong&gt; The annotated method will run before the first test method in the current class is invoked.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;@AfterMethod:&lt;/strong&gt; The annotated method will run after each test method has been run.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;@BeforeMethod:&lt;/strong&gt; The annotated method will run before each test method has been run.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a class="comment-mentioned-user" href="https://dev.to/test"&gt;@test&lt;/a&gt;
:&lt;/strong&gt; This annotated method is a part of a test case.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are several benefits of the available TestNG Annotations-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;By looking up annotations, it describes the methods that it is interested in. Method names are also not limited to any pattern or format.&lt;/li&gt;
&lt;li&gt;We can pass annotations with additional parameters.&lt;/li&gt;
&lt;li&gt;Annotations are strongly typed so that the compiler can flag any errors right away.&lt;/li&gt;
&lt;li&gt;Test classes are no longer needed for extensions. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Writing a Basic Test in TestNG&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now that we have essential elements in place let us see the primary steps involved in creating a TestNG test.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Write the business logic of the test.&lt;/li&gt;
&lt;li&gt;Insert TestNG annotations in the code.&lt;/li&gt;
&lt;li&gt;Include the test information (e.g., the methods names, class names, group names, etc.) in a testng.xml file.&lt;/li&gt;
&lt;li&gt;Run TestNG.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; TestNG requires JDK 8 or higher. You can refer to our complete &lt;a href="https://www.lambdatest.com/learning-hub/testng?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Piyusha-24032021&amp;amp;utm_term=Piyusha"&gt;TestNG Tutorial&lt;/a&gt; to start from the basics.&lt;/p&gt;

&lt;p&gt;Below is a straightforward test is written in TestNG:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package example1;

import org.testng.annotations.*;

public class SimpleTest {

 @BeforeClass
 public void setUp() {
   // here would be the code that will be invoked when this test is instantiated
 }

 @Test(groups = { "fast" })
 public void aFastTest() {
   System.out.println("Fast test executed");
 }

 @Test(groups = { "slow" })
 public void aSlowTest() {
    System.out.println("Slow test executed");
 }

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using @BeforeClass and &lt;a class="comment-mentioned-user" href="https://dev.to/test"&gt;@test&lt;/a&gt;
, i.e., after the test class is built &amp;amp; before any test method is run, the setUp() method will be invoked. We will run the group quickly in this example, so aFastTest() is invoked while a SlowTest() is skipped.&lt;/p&gt;

&lt;p&gt;Things to Note:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;No need to implement an interface or extend a class.&lt;/li&gt;
&lt;li&gt;Even though the above example uses the JUnit conventions, it is the annotations that tell TestNG what our methods can be called any name you like.&lt;/li&gt;
&lt;li&gt;A test method could belong to one or multiple groups.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We can either invoke our test using the command line, the ant task (as shown below), or the XML file: once you have compiled your test class into the build directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;project default="test"&amp;gt;

 &amp;lt;path id="cp"&amp;gt;
   &amp;lt;pathelement location="lib/testng-testng-5.13.1.jar"/&amp;gt;
   &amp;lt;pathelement location="build"/&amp;gt;
 &amp;lt;/path&amp;gt;

 &amp;lt;taskdef name="testng" classpathref="cp"
          classname="org.testng.TestNGAntTask" /&amp;gt;

 &amp;lt;target name="test"&amp;gt;
   &amp;lt;testng classpathref="cp" groups="fast"&amp;gt;
     &amp;lt;classfileset dir="build" includes="example1/*.class"/&amp;gt;
   &amp;lt;/testng&amp;gt;
 &amp;lt;/target&amp;gt;

&amp;lt;/project&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use ant to invoke it:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;c:&amp;gt; ant&lt;/code&gt;&lt;br&gt;&lt;br&gt;
Buildfile: build.xml&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_vX36Prx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/Output.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_vX36Prx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/Output.png" alt="Output"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The test results can be browsed using:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;start test-output\index.html&lt;/code&gt; (on Windows)&lt;/p&gt;

&lt;p&gt;If you don’t like this process of getting the test results, there’s an easier way to do it. It is also possible to generate the TestNG reports in Jenkins. There is a plugin Jenkins offers to accomplish this task. The plugin is the TestNG Results plugin. This next section will find out how to generate TestNG report in Jenkins with this plugin.&lt;/p&gt;

&lt;p&gt;You might also like- &lt;a href="https://www.lambdatest.com/blog/phpunit-code-coverage-report-html/?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Piyusha-24032021&amp;amp;utm_term=Piyusha"&gt;Generate PHPUnit Coverage Report In HTML and XML&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  TestNG Results Plugin
&lt;/h2&gt;

&lt;p&gt;TestNG Results plugin enables you to publish the results of TestNG created using org.testng.reporters.XMLReporter.TestNG The resulting XML file contains more details than the XML file of the JUnit framework. In graph and table reports, this plugin reveals such additional information. The plugin also makes it possible to import the XML TestNG reports in Jenkins from each build.&lt;/p&gt;

&lt;p&gt;Now getting to the ‘how’ part of ‘how to generate TestNG report in Jenkins’- data is parsed using the output that org.testng.reporters.XMLReporter generates. The results are shown with a trend graph, and all the specifics of the failed tests are also presented. And that’s how TestNG reports in Jenkins look like!&lt;/p&gt;

&lt;p&gt;Let’s find out more about a Jenkins Selenium report.&lt;/p&gt;

&lt;h3&gt;
  
  
  Features of TestNG Results Plugin
&lt;/h3&gt;

&lt;p&gt;A Jenkins Selenium report generated using TestNG Results plugin offers the following features-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The page layouts are intentionally designed so that they look very similar to Jenkins’s JUnit plugin. Also known for the fact JUnit inspires them.&lt;/li&gt;
&lt;li&gt;You will see a summary of passed/fail checks and passed/fail configuration methods on the project/build tab. To see the test failure, it also enlists the failed test cases with a direct connection.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wwDCR4Yq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/test-summary.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wwDCR4Yq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/test-summary.png" alt="test-summary"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The test methods in the class result summary page are separated from the configuration method.&lt;/li&gt;
&lt;li&gt;In the Package result summary, we can see the order in which test methods were run during the regression run.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--H5TTr215--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/execution-order.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--H5TTr215--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/execution-order.png" alt="execution-order"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The pass/failed pattern of previous job results will be seen in different graphs.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XNkE9xjR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/test-graph.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XNkE9xjR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/test-graph.png" alt="test-graph"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Able to hide or expand tables that display package and class results.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Utilities of TestNG Results Plugin
&lt;/h3&gt;

&lt;p&gt;Using this plugin is very straightforward once you have configured your build to run TestNG-based test cases and figured out how to generate TestNG report in Jenkins. Simply trigger Publish TestNG Results in Post-Build Behavior.&lt;/p&gt;

&lt;p&gt;This option enables the following properties to be configured:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;TestNG XML report pattern-&lt;/strong&gt; This is a pattern for the file name that can be used to find the TestNG XML report files (for example, */target/testng-results.xml*). The path is either an Ant-style pattern (e.g., fileset) or a list of files and folders separated by the characters’;:,’. It is also vital that TestNG be configured to generate an XML Jenkins Selenium report using _org.testng.reporters. This is to ensure XMLReporter for this plugin functions properly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Escape Test Description string-&lt;/strong&gt; If checked, while displaying test method results, the plugin escapes the description string that is associated with the test method. Unchecking allows us to use HTML tags to format the description, which is enabled by default.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Escape exception messages-&lt;/strong&gt; If checked, the plugin escapes the test method’s exception messages. Unchecking allows you to use HTML tags to format the exception message, e.g., embed links in the text. This is enabled by default.&lt;/li&gt;
&lt;li&gt;Show Failed Builds- If selected, the plugin includes results from the failed builds in the trend graph. This is disabled by default.

&lt;ul&gt;
&lt;li&gt;In case this is a maven build, it is always better to configure the build step with -Dmaven.test.failure.ignore=true option. This results in the build with test failures being marked as Unstable, thus distinguishing it from the build that failed because of issues not related to the tests.&lt;/li&gt;
&lt;li&gt;Also, even when this option is selected, failed builds with no results and aborted builds will not be displayed in graphs.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Marking the build as a failure on a failed configuration-&lt;/strong&gt; This marks the build as failed if there are any configuration method failures.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Configuring thresholds for marking the build as Unstable/Failed-&lt;/strong&gt; A Threshold Mode can be configured by the user as a number of tests or a percentage of tests and then configured separately for these values. Even if there are several test failures or label the build as failed, even if there is a single test method failure, this allows for situations where we want the builds to be marked successful.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  How to Generate TestNG Reports in Jenkins?
&lt;/h2&gt;

&lt;p&gt;Now let us see how to generate TestNG Report in Jenkins. To be able to do this, you need to have all the required tools in your system.&lt;/p&gt;

&lt;p&gt;Prerequisites-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;TestNG Project&lt;/li&gt;
&lt;li&gt;Jenkins – You can check Jenkins installation &lt;a href="https://www.lambdatest.com/blog/what-is-jenkins/"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;TestNG Results Plugin in Jenkins&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once you have all this installed, we can get started with a TestNG Project.&lt;/p&gt;

&lt;h3&gt;
  
  
  How To Create a TestNG Project?
&lt;/h3&gt;

&lt;p&gt;In order to generate TestNG reports in Jenkins, we need to start from scratch. First, we will create a TestNG project. To create a TestNG project, you will need to follow the steps mentioned below-&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Open Eclipse and create a Java class.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Keep all the library files in a folder.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Write a Java program.&lt;/p&gt;

&lt;p&gt;The below snippet highlights all the three steps mentioned above.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_AmMccnF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/pasted-image-0-10.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_AmMccnF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/pasted-image-0-10.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4:&lt;/strong&gt; Now convert the Java Program into TestNG.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--az0HzM5c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/pasted-image-0-1-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--az0HzM5c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/pasted-image-0-1-1.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Alternative Method-&lt;/strong&gt; Another way you can create a TestNG Project is by creating a new TestNG project all from the beginning.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Click File –&amp;gt; New –&amp;gt; Java Project&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ur2g3qCA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/testng.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ur2g3qCA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/testng.png" alt="testng"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Give it an arbitrary Project Name, say “FirstTestNGProject” and then click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SPsd9N7i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/FirstTestNGProject.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SPsd9N7i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/FirstTestNGProject.png" alt="FirstTestNGProject"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Next step is to start importing the TestNG Libraries into the project. Click on the “ &lt;strong&gt;Libraries” tab –&amp;gt; “Add Library”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6gvvXFLU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/Add-Library.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6gvvXFLU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/Add-Library.png" alt="Add Library"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4:&lt;/strong&gt; Choose “TestNG” on the Add Library dialog, and click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wnPoE_65--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/testng-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wnPoE_65--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/testng-1.png" alt="testng"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5:&lt;/strong&gt; Click on &lt;strong&gt;Finish&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aj6rAugw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/step_5-0041.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aj6rAugw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/step_5-0041.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It should be noticed that TestNG is included on the Libraries list.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IRHgUQCq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/step_5_b-0040.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IRHgUQCq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/step_5_b-0040.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6:&lt;/strong&gt; The JAR files containing the Selenium API will now be added. These files are located in the Java client driver we downloaded from &lt;a href="http://docs.seleniumhq.org/download/"&gt;http://docs.seleniumhq.org/download/&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MiLn8y0W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/Selenium-API.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MiLn8y0W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/Selenium-API.png" alt="Selenium API"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, navigate to where the Selenium JAR files are placed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YutkOlEL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/step_6b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YutkOlEL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/step_6b.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After adding the external JARs, the screen should appear like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9hN72VC2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/step_6c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9hN72VC2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/step_6c.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 7:&lt;/strong&gt; Click on Finish and confirm that our FirstTestNGProject is visible on Eclipse’s Package Explorer window.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dPjDxTHG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/FirstTestNGProject-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dPjDxTHG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/FirstTestNGProject-1.png" alt="FirstTestNGProject"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After we have the TestNG project, the next step is to install Jenkins. You can refer to the guided steps for Jenkins installation in our &lt;a href="https://www.lambdatest.com/learning-hub/jenkins?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Piyusha-24032021&amp;amp;utm_term=Piyusha"&gt;Jenkins Tutorial&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now that we have TestNG Project and Jenkins platform ready, the next step is to install TestNG Reports Plugin in Jenkins.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing TestNG Reports Plugin In Jenkins
&lt;/h2&gt;

&lt;p&gt;The next and the most crucial step to know how to generate TestNG report in Jenkins is to install the TestNG Reports plugin. To install the plugin in Jenkins, follow these steps-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open Jenkins (localhost:8080).&lt;/li&gt;
&lt;li&gt;Click on ‘ &lt;strong&gt;Manage Jenkins&lt;/strong&gt; ‘ → Click on ‘ &lt;strong&gt;Manage Plugins&lt;/strong&gt; ‘&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--euz4tkYS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/TestNG-Reports-Using-Jenkins-1-1024x604.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--euz4tkYS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/TestNG-Reports-Using-Jenkins-1-1024x604.png" alt="TestNG-Reports-Using-Jenkins-1"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click on ‘ &lt;strong&gt;Available&lt;/strong&gt; ‘ tab&lt;/li&gt;
&lt;li&gt;Select ‘ &lt;strong&gt;TestNG Results Plugin&lt;/strong&gt; ‘ &lt;/li&gt;
&lt;li&gt;Click on ‘ &lt;strong&gt;Install Without Restart&lt;/strong&gt; ‘&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rUDInt1C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/TestNG-Reports-Using-Jenkins-2-1024x299.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rUDInt1C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/TestNG-Reports-Using-Jenkins-2-1024x299.png" alt="TestNG-Reports-Using-Jenkins"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the ‘ &lt;strong&gt;TestNGProject&lt;/strong&gt; ’ Job created earlier. &lt;/li&gt;
&lt;li&gt;Click on ‘ &lt;strong&gt;Configure&lt;/strong&gt; ’ and scroll down to select ‘ &lt;strong&gt;Post Build Actions&lt;/strong&gt; ’&lt;/li&gt;
&lt;li&gt;Click on ‘ &lt;strong&gt;Add Post Build Actions&lt;/strong&gt; ’ dropdown list.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UcvlTWcB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/TestNG-Reports-Using-Jenkins-3-1024x765.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UcvlTWcB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/TestNG-Reports-Using-Jenkins-3-1024x765.png" alt="TestNG-Reports-Using-Jenkins-3"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;And select ‘ &lt;strong&gt;Publish TestNG Results&lt;/strong&gt; ‘. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--X65h5B8r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/TestNG-Reports-Using-Jenkins-4-1024x700.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--X65h5B8r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/TestNG-Reports-Using-Jenkins-4-1024x700.png" alt="TestNG-Reports-Using-Jenkins-4"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In the &lt;strong&gt;TestNG XML Report Pattern&lt;/strong&gt; edit box enter ‘ &lt;strong&gt;**/testng-results.xml&lt;/strong&gt; ‘ and click ‘ &lt;strong&gt;Save&lt;/strong&gt; ‘ &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0eZUh3lN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/TestNG-Reports-Using-Jenkins-5-1024x771.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0eZUh3lN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/TestNG-Reports-Using-Jenkins-5-1024x771.png" alt="TestNG-Reports-Using-Jenkins-"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;We have already created a new project ‘ &lt;strong&gt;TestNGProject&lt;/strong&gt; ‘to run TestNG Tests and generate TestNG Reports after execution using Jenkins.&lt;/li&gt;
&lt;li&gt;Click on the ‘ &lt;strong&gt;Build Now&lt;/strong&gt; ‘ button to execute it. This will invoke &lt;strong&gt;testng.xml&lt;/strong&gt; from the batch file.&lt;/li&gt;
&lt;li&gt;Right-click on Build Number and click on Console Output to see the result.&lt;/li&gt;
&lt;li&gt;Once the execution is completed, there will be a link to view ‘TestNG Results’&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SmvnHLqA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/TestNG-Reports-Using-Jenkins-7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SmvnHLqA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/TestNG-Reports-Using-Jenkins-7.png" alt="TestNG-Reports-Using-Jenkins-7"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There you go- that’s how to generate TestNG Report in Jenkins!&lt;/p&gt;

&lt;h3&gt;
  
  
  Alternative Method To Generate TestNG Reports in Jenkins
&lt;/h3&gt;

&lt;p&gt;There’s another way to set up the TestNG reports in Jenkins Dashboard.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Login into Jenkins.&lt;/li&gt;
&lt;li&gt;Manage Jenkins and Install TestNG Result Plugin. &lt;/li&gt;
&lt;li&gt;Please make sure that you restart Jenkins after the plugin installation.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fVSZCUjn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/TestngResultPlugin.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fVSZCUjn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/TestngResultPlugin.jpg" alt="TestngResultPlugin"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Next, go to Jenkins Home Page → Create New Jenkins Job and in Post-Build Action select → Publish TestNg Result.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tYboKnnA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/TestNgPostBuild.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tYboKnnA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/TestNgPostBuild.jpg" alt="TestNg+PostBuild"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Now either give the complete path of your testng-result.xml or type **/testng-results.xml in TestNG XML report pattern to search inside your project workspace.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---fdsF59E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/PublishTestNG.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---fdsF59E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/PublishTestNG.jpg" alt="PublishTestNG"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Execute your Jenkins Job, and Now your Jenkins Selenium report or ‘ &lt;strong&gt;TestNG Results&lt;/strong&gt; ’ would be visible in Your Jenkins Dashboard.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aqw7-sVF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/TestNgResult.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aqw7-sVF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/TestNgResult.jpg" alt="TestNg+Result"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1wiop5od--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/TestNGResultCapture.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1wiop5od--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/TestNGResultCapture.jpg" alt="TestNG+ResultCapture"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Share TestNG Reports in Jenkins?
&lt;/h2&gt;

&lt;p&gt;In the sections above, we saw how to generate TestNG report in Jenkins or Jenkins Selenium report, as some like to call them. Once you have generated those TestNG reports in Jenkins, what would you like to do with them? The ultimate goal of generating a Jenkins Selenium report is to share them!&lt;/p&gt;

&lt;p&gt;There is a possibility to send those email notifications directly from Jenkins along with the generated TestNG reports. In this section, we will learn how to email the generated &lt;a href="https://www.lambdatest.com/blog/how-to-generate-testng-reports-in-jenkins/?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Piyusha-24032021&amp;amp;utm_term=Piyusha"&gt;Jenkins Selenium report&lt;/a&gt; to team members, leads or even managers.&lt;/p&gt;

&lt;p&gt;Let’s see how we can accomplish this-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Start ‘jenkins.war’ file to get started with Jenkins ( Assuming it is already installed ).&lt;/li&gt;
&lt;li&gt;Open Jenkins (&lt;code&gt;http://localhost:8080&lt;/code&gt;). &lt;/li&gt;
&lt;li&gt;We would need a required set of Plugins before we start:

&lt;ul&gt;
&lt;li&gt;Email Extension&lt;/li&gt;
&lt;li&gt;Email Extension Template Plugin&lt;/li&gt;
&lt;li&gt;TestNG Results&lt;/li&gt;
&lt;li&gt;Selenium HTML Report&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Configuration for Sending Email

&lt;ul&gt;
&lt;li&gt;Go to &lt;strong&gt;Jenkins –&amp;gt; Manage Jenkins –&amp;gt; Configure System –&amp;gt; Email Notification&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Enter the email id in the “ &lt;strong&gt;SMTP Server&lt;/strong&gt; ” edit field. For e.g. “smtp.gmail.com” &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3DzGPQJG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/email1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3DzGPQJG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/email1.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click on “ &lt;strong&gt;Advanced&lt;/strong&gt; ” and configure as shown in the below image. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--enlAM5Xb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/pasted-image-0-2-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--enlAM5Xb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/pasted-image-0-2-1.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Username and password need to be provided for the account from where we want to send the email notification( You can either use your corporate Email or personal based on situations).&lt;/li&gt;
&lt;li&gt;It is always better for testing purposes to check the “Test configuration by sending test email” checkbox to validate whether Email was sent successfully or not.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yMJftqZC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/email3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yMJftqZC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/email3.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enter the recipient’s email address and click on “Test Configuration” button.&lt;/li&gt;
&lt;li&gt;If we can see the “Email was successfully sent” message, then it can be confirmed that the configuration is correct.&lt;/li&gt;
&lt;li&gt;If we see any error message, it could be either because the configuration is incorrect or security access issues. Follow the below steps to enable “Less secure app access.”&lt;/li&gt;
&lt;li&gt;Navigate to &lt;a href="https://myaccount.google.com/"&gt;https://myaccount.google.com/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Click on “ &lt;strong&gt;Security&lt;/strong&gt; “&lt;/li&gt;
&lt;li&gt;Go to the “Less secure app access” section and switch it on.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JzeXUK3T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/email5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JzeXUK3T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/email5.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Yay! You are all set to send the email notification for TestNG reports in Jenkins!!&lt;/p&gt;

&lt;p&gt;Now it’s time to test this.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to Jenkins Dashboard &lt;/li&gt;
&lt;li&gt;Create a new Job.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cEOQDvEi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/email6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cEOQDvEi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/email6.png" alt="email"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Let us create a new project named “VerifyEmailNotification”.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Give the Project Description and select ‘Execute Batch Command’ from the Build drop-down and enter any invalid commands as shown in the image below, as each unstable build will receive an email. (Then only email alerts will be sent if the build fails).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TjSb96kk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/email6-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TjSb96kk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/email6-1.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Select “Email Notification” from “Post-build Actions” and add the email address of the recipient and check “Send email for every unstable build” as shown in the image below.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Gbgk0QB---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/pasted-image-0-3-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Gbgk0QB---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/pasted-image-0-3-1.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click on “Save.” &lt;/li&gt;
&lt;li&gt;Now click on “Build Now” to start the execution.&lt;/li&gt;
&lt;li&gt;Go to “Console Output” to verify the result.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5MDuZb1e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/email9-1024x376.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5MDuZb1e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/email9-1024x376.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Validate the recipient’s mail to confirm if the email was sent from Jenkins.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KV-euYbI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/pasted-image-0-4-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KV-euYbI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/pasted-image-0-4-1.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that we are confident our email notifications are working, let us configure Jenkins to attach a TestNG Report in the Email.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to Jenkins –&amp;gt; Manage Jenkins –&amp;gt; Configure System –&amp;gt; Extended Email Notification&lt;/li&gt;
&lt;li&gt;Enter “smtp.gmail.com” in the “SMTP Server” edit field NOTE: Here, Gmail is taken just as an example.&lt;/li&gt;
&lt;li&gt;Next, click on “Advanced” and fill in the details as shown below.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BgvNz6YV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/pasted-image-0-5-1-1024x397.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BgvNz6YV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/pasted-image-0-5-1-1024x397.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click on “Save.” &lt;/li&gt;
&lt;li&gt;Go to Jenkins dashboard and create either a new project, or you can choose an existing project. Here we have an existing project [Flight Reservation (POM)]&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--m0BK0y_9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/email12-1024x504.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--m0BK0y_9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/email12-1024x504.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click on Configure on the left-hand side.&lt;/li&gt;
&lt;li&gt;Select “Editable Email Notification” from “Post-build Actions”&lt;/li&gt;
&lt;li&gt;Click on “Advanced Settings”&lt;/li&gt;
&lt;li&gt;Select “Always” from the “Add Trigger” dropdown.&lt;/li&gt;
&lt;li&gt;Click on “Advanced” and fill in the details as shown below.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ELMISmJS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/pasted-image-0-6-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ELMISmJS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/pasted-image-0-6-1.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mention the path of emailable-report.html of TestNG in the Content edit field.&lt;/li&gt;
&lt;li&gt;Click on “ &lt;strong&gt;Save&lt;/strong&gt;.”&lt;/li&gt;
&lt;li&gt;Next, click on “ &lt;strong&gt;Build Now&lt;/strong&gt; ” to start the execution of the job.&lt;/li&gt;
&lt;li&gt;Navigate to “ &lt;strong&gt;Console Output&lt;/strong&gt; ” to check the result.&lt;/li&gt;
&lt;li&gt;Validate your recipient mail to see the Test Execution report.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gmCQ_VQ_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/pasted-image-0-7-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gmCQ_VQ_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lambdatest.com/blog/wp-content/uploads/2021/02/pasted-image-0-7-1.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And here you go. Now you are ready to generate TestNG reports in Jenkins &amp;amp; share those Jenkins Selenium reports!&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;I hope this blog has helped you take report generation and sharing one step ahead. Now you not only know how to generate TestNG report in Jenkins, but you have also learned how to share those TestNG reports in Jenkins via Email. It’s time to elevate Jenkins &amp;amp; TestNG’s functioning by sending out the email notification with your very next Jenkins &lt;a href="https://lambdatest.com/selenium?utm_source=dev&amp;amp;utm_medium=Blog&amp;amp;utm_campaign=Piyusha-24032021&amp;amp;utm_term=Piyusha"&gt;Selenium&lt;/a&gt; report. Let me know how it goes in the comments section below.&lt;/p&gt;

&lt;p&gt;Happy testing!&lt;/p&gt;

</description>
      <category>jenkins</category>
      <category>devops</category>
      <category>cicd</category>
      <category>testng</category>
    </item>
  </channel>
</rss>
