# Error generating report in Jenkins following a Postman collection run

**URL:** <https://community.postman.com/t/error-generating-report-in-jenkins-following-a-postman-collection-run/16611>\
**Category:** Help Hub\
**Tags:** newman-project, postman, jenkins\
**Created:** [October 9, 2020, 12:10pm UTC](https://community.postman.com/t/error-generating-report-in-jenkins-following-a-postman-collection-run/16611 "2020-10-09T12:10:39Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![oasis](https://avatars.discourse-cdn.com/v4/letter/o/a698b9/32.png) [@oasis](https://community.postman.com/u/oasis)\
**Post date:** [October 9, 2020, 12:10pm UTC](https://community.postman.com/t/error-generating-report-in-jenkins-following-a-postman-collection-run/16611/1 "2020-10-09T12:10:40Z")

</div>

> **Archived topic — this may be out of date.**  
> Newman has been replaced by the **[Postman CLI](https://learning.postman.com/docs/postman-cli/postman-cli-overview/)**, Postman’s official, signed command-line tool. It runs collections as Newman did, and also lints API specs, runs mocks and monitors, and syncs local files with Postman from your terminal, CI/CD pipeline or coding agent.  
> Working with an AI coding agent? The [Postman plugin](https://github.com/postmanlabs/postman-plugin) lets agents in Claude Code, Cursor, Codex and others design, mock, test and ship APIs with Postman.  
> For current help, see the [Postman docs](https://learning.postman.com/docs/), try the free [Postman tools](https://www.postman.com/tools) (no account needed), or join us on [Discord](https://discord.gg/58aNNsRBGR).

I have been struggling with generation of report in Jenkins and I was wondering if anyone could throw some light into it.

Collection from package.json:-

“scripts”: {  
“api-tests”: “newman run postmancollection/test\_Api.postman\_collection.json -e PostmanEnv/Test.postman\_environment.json --reporters cli,junit --reporter-junit-export newman.xml --insecure”  
},

Pipeline:-

```
        pipeline {
      agent {
            docker {
                image 'node:10-alpine'
                args '-p 3000:3000 -p 5000:5000'
                args '-u 0:0'

            }
      }

       stages{
          stage('Postman tests') {
             steps{
                
               git 'git@gitlab.dev.com:t2-test-automation/tests.git'
                sh 'npm install -g newman'
                   sh 'npm run api-tests'
                    junit 'newman.xml'
       
             }
          }
       }
    }

```

Error ;-

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/2/5/252bb5a4ec3565388289d1f7b1cb2a60619059d0.png)

---

<div class="post-metadata">

**Author:** ![gpub1](https://avatars.discourse-cdn.com/v4/letter/g/f6c823/32.png) [@gpub1](https://community.postman.com/u/gpub1)\
**Post date:** [October 9, 2020, 9:12pm UTC](https://community.postman.com/t/error-generating-report-in-jenkins-following-a-postman-collection-run/16611/2 "2020-10-09T21:12:13Z")

</div>

seems like newman command is wrong with initial looking, please share the log file ?

---

<div class="post-metadata">

**Author:** ![oasis](https://avatars.discourse-cdn.com/v4/letter/o/a698b9/32.png) [@oasis](https://community.postman.com/u/oasis)\
**Post date:** [October 9, 2020, 11:39pm UTC](https://community.postman.com/t/error-generating-report-in-jenkins-following-a-postman-collection-run/16611/3 "2020-10-09T23:39:31Z")

</div>

@gpub1, I have to raise a ticket to get the logs unfortunately. However, I can see the tests being run, though failed which is expected, with cli report.

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/f/8/f82ef5980e5fb6ab81b05a6f0142b71fbabf0495.png)

---

<div class="post-metadata">

**Author:** ![gpub1](https://avatars.discourse-cdn.com/v4/letter/g/f6c823/32.png) [@gpub1](https://community.postman.com/u/gpub1)\
**Post date:** [October 12, 2020, 1:57pm UTC](https://community.postman.com/t/error-generating-report-in-jenkins-following-a-postman-collection-run/16611/4 "2020-10-12T13:57:13Z")

</div>

good its working now … no need for logs 🙂 keep working 👍

---

<div class="post-metadata">

**Author:** ![oasis](https://avatars.discourse-cdn.com/v4/letter/o/a698b9/32.png) [@oasis](https://community.postman.com/u/oasis)\
**Post date:** [October 12, 2020, 2:09pm UTC](https://community.postman.com/t/error-generating-report-in-jenkins-following-a-postman-collection-run/16611/5 "2020-10-12T14:09:33Z")

</div>

@gpub1 Thanks, but I do have another question if that’s ok?  
I am able to run the below command locally and get the xml reports as expected, but when I run it through a pipeline job, I get the message, ‘Found 0 xml files’

newman run postmancollection/SampleTests.postman\_collection.json --reporters cli,junit --reporter-junit-export newman.xml

Pipeline:-

pipeline {  
agent {  
docker {  
image ‘node:10-alpine’  
args ‘-p 3000:3000 -p 5000:5000’  
args ‘-u 0:0’

```
    }

```

}

stages{

```
    stage("Checkout API-Test") {
        steps {
   
            checkout(
                    [$class : 'GitSCM',
                     branches : [[name: "master"]],
                     userRemoteConfigs: [[url: "git@gitlab.dev.com:test-automation/tests.git"]]]
              
            )

    }
    }
   
   
   
  stage('Postman tests') {
     steps{
        
       script{
           try{
        sh 'npm install -g newman'
           sh 'npm run api_sample'
           currentBuild.result = 'SUCCESS'
          

     } catch (Exception ex) {
                    currentBuild.result = 'FAILURE'
                }
     }
       junit 'newman.xml'

```

}  
}  
}

---

<div class="post-metadata">

**Author:** ![gpub1](https://avatars.discourse-cdn.com/v4/letter/g/f6c823/32.png) [@gpub1](https://community.postman.com/u/gpub1)\
**Post date:** [October 12, 2020, 2:15pm UTC](https://community.postman.com/t/error-generating-report-in-jenkins-following-a-postman-collection-run/16611/6 "2020-10-12T14:15:32Z")

</div>

Looks like again due to some spacing in path  
try removing -g from this command `sh 'npm install -g newman''`

---

<div class="post-metadata">

**Author:** ![oasis](https://avatars.discourse-cdn.com/v4/letter/o/a698b9/32.png) [@oasis](https://community.postman.com/u/oasis)\
**Post date:** [October 12, 2020, 2:19pm UTC](https://community.postman.com/t/error-generating-report-in-jenkins-following-a-postman-collection-run/16611/7 "2020-10-12T14:19:41Z")

</div>

@gpub1, It didn’t help unfortunately

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/2/a/2aa14221d27246c58d8afbb4266775b2e4765b70.png)

---

<div class="post-metadata">

**Author:** ![gpub1](https://avatars.discourse-cdn.com/v4/letter/g/f6c823/32.png) [@gpub1](https://community.postman.com/u/gpub1)\
**Post date:** [October 12, 2020, 2:30pm UTC](https://community.postman.com/t/error-generating-report-in-jenkins-following-a-postman-collection-run/16611/8 "2020-10-12T14:30:50Z")

</div>

> [@oasis](#):
>
> Found 0 xml files

for you hopefully this help [Notfound](https://stackoverflow.com/questions/14933375/jenkins-junit-test-result-report-plugin-states-that-the-junit-xml-file-is-not-fo)
