title: Jenkins Pipeline - Jmeter Performance report
body: <p>I have the below Jenkins pipeline script to run the jmeter tests and make a report from a JTL file</p>
  
  <pre><code>node('master') {
      stage 'Run JMeter Test'
      def workspace = pwd()
      def jmeterTestFile = 'jenkins_test'
      echo "workspace = ${workspace}"
      echo "env.WORKSPACE = ${env.WORKSPACE}"
      bat "${workspace}\\jmeter\\bin\\jmeter.bat -n -t ${workspace}\\jmeter_scripts\\${jmeterTestFile}.jmx -l ${workspace}\\jmeter_scripts\\${jmeterTestFile}_results.jtl"
       step([$class: 'ArtifactArchiver', artifacts: 'CP-Perf-Report.html,**/*.jtl, **/jmeter.log', fingerprint: true])
      //perfReport "jmeter_scripts\\${jmeterTestFile}_results.jtl"
      performanceReport parsers: [[$class: 'JMeterParser', glob: "jmeter_scripts\\${jmeterTestFile}_results.jtl"]], relativeFailedThresholdNegative: 1.2, relativeFailedThresholdPositive: 1.89, relativeUnstableThresholdNegative: 1.8, relativeUnstableThresholdPositive: 1.5
  }
  </code></pre>
  
  <p>Initially I tried creating report with <code>perfReport "jmeter_scripts\\${jmeterTestFile}_results.jtl"</code> command but it was failing with <code>FileNotFoundException</code> so I tried alternative way using <code>performanceReport parsers</code> but even then its failing again with <code>FileNotFoundException</code> but I can manually open the <code>c:\tools\jenkins\workspace\PerformanceTesting\jmeter_scripts\jenkins_test_results.jtl</code> file and see the test report. can anyone help me to fix this issue?</p>
  
  <pre><code>workspace = c:\tools\jenkins\workspace\PerformanceTesting
  [Pipeline] echo
  env.WORKSPACE = c:\tools\jenkins\workspace\PerformanceTesting
  [Pipeline] step
  Archiving artifacts
  Recording fingerprints
  [Pipeline] step
  [Pipeline] }
  [Pipeline] // node
  [Pipeline] End of Pipeline
  java.io.FileNotFoundException: c:\tools\jenkins\workspace\PerformanceTesting\jmeter_scripts\jenkins_test_results.jtl (The system cannot find the path specified)
      at java.io.FileInputStream.open0(Native Method)
      at java.io.FileInputStream.open(Unknown Source)
      at java.io.FileInputStream.&lt;init&gt;(Unknown Source)
      at java.io.FileReader.&lt;init&gt;(Unknown Source)
      at hudson.plugins.performance.parsers.ParserDetector.detect(ParserDetector.java:21)
      at hudson.plugins.performance.parsers.ParserFactory.getParser(ParserFactory.java:26)
      at hudson.plugins.performance.PerformancePublisher.getParsers(PerformancePublisher.java:439)
      at hudson.plugins.performance.PerformancePublisher.perform(PerformancePublisher.java:481)
      at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:69)
      at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:59)
      at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:52)
      at hudson.security.ACL.impersonate(ACL.java:221)
      at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:49)
      at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
  Finished: FAILURE
  </code></pre>