ReferenceError in test-script
See original GitHub issueAll tests fail with two ReferenceError in test-script
via newman. Tests are ok throught postman UI.
- Newman Version: 3.9.2
- OS details (type, version, and architecture): Windows 10- 64 bits
- Are you using Newman as a library, or via the CLI: CLI
- Did you encounter this recently, or has this bug always been there: I’m new to newman
- Expected behaviour: All tests shouls succeed
- Command / script used to run Newman:
NODE_DEBUG=request newman run https://api.getpostman.com/collections/340554-d362e66e-d68e-4445-e304-ff59fc652160?apikey=myApiKey \ --environment /c/var/myEnvironement.json \ --folder download \ --iteration-data ./CI/postman_data_files/download.csv \ --color
- Sample collection, and auxiliary files (minus the sensitive details):
- Screenshots (if applicable):
Output logs:
Iteration 1/28
□ download
└ Get one export JSON
GET http://localhost:8080/exports/normal/INTERVIEWS_STATS/JSON REQUEST { headers:
{ 'SA-requested-room': 'brand1.superlocal.com',
Authorization: 'Bearer 00c39dcf-ed6f-4625-b443-9deb6c8d9d28',
'User-Agent': 'PostmanRuntime/7.1.3',
Accept: '*/*',
Host: 'localhost:8080' },
url: 'http://localhost:8080/exports/normal/INTERVIEWS_STATS/JSON',
method: 'GET',
jar:
RequestJar {
_jar: CookieJar { enableLooseMode: true, store: { idx: {} } } },
gzip: true,
useQuerystring: true,
followRedirect: true,
followAllRedirects: true,
encoding: null,
lookup: [Function: bound lookup],
agentOptions: { keepAlive: true },
callback: [Function] }
REQUEST make request http://localhost:8080/exports/normal/INTERVIEWS_STATS/JSON
REQUEST onRequestResponse http://localhost:8080/exports/normal/INTERVIEWS_STATS/JSON 200 { 'content-encoding': 'gzip',
connection: 'keep-alive',
'cache-control': 'no-cache, must-revalidate, no-transform',
'x-powered-by': 'Undertow/1',
server: 'WildFly/8',
'content-type': 'application/json;charset=UTF-8',
'content-length': '3015',
date: 'Fri, 12 Jan 2018 14:55:08 GMT' }
REQUEST reading response's body
REQUEST finish init function http://localhost:8080/exports/normal/INTERVIEWS_STATS/JSON
REQUEST response end http://localhost:8080/exports/normal/INTERVIEWS_STATS/JSON 200 { 'content-encoding': 'gzip',
connection: 'keep-alive',
'cache-control': 'no-cache, must-revalidate, no-transform',
'x-powered-by': 'Undertow/1',
server: 'WildFly/8',
'content-type': 'application/json;charset=UTF-8',
'content-length': '3015',
date: 'Fri, 12 Jan 2018 14:55:08 GMT' }
REQUEST end event http://localhost:8080/exports/normal/INTERVIEWS_STATS/JSON
REQUEST has body http://localhost:8080/exports/normal/INTERVIEWS_STATS/JSON 5940
REQUEST emitting complete http://localhost:8080/exports/normal/INTERVIEWS_STATS/JSON
[200 OK, 3.21KB, 2.4s]
1⠄ ReferenceError in test-script
2⠄ ReferenceError in test-script
└ Get one export CSV
GET http://localhost:8080/exports/normal/INTERVIEWS_STATS/CSV REQUEST { headers:
{ 'SA-requested-room': 'brand1.superlocal.com',
Authorization: 'Bearer 00c39dcf-ed6f-4625-b443-9deb6c8d9d28',
'User-Agent': 'PostmanRuntime/7.1.3',
Accept: '*/*',
Host: 'localhost:8080' },
url: 'http://localhost:8080/exports/normal/INTERVIEWS_STATS/CSV',
method: 'GET',
jar:
RequestJar {
_jar: CookieJar { enableLooseMode: true, store: { idx: {} } } },
gzip: true,
useQuerystring: true,
followRedirect: true,
followAllRedirects: true,
encoding: null,
lookup: [Function: bound lookup],
agentOptions: { keepAlive: true },
callback: [Function] }
REQUEST make request http://localhost:8080/exports/normal/INTERVIEWS_STATS/CSV
REQUEST onRequestResponse http://localhost:8080/exports/normal/INTERVIEWS_STATS/CSV 200 { 'content-encoding': 'gzip',
connection: 'keep-alive',
'cache-control': 'no-cache, must-revalidate, no-transform',
'x-powered-by': 'Undertow/1',
server: 'WildFly/8',
'content-type': 'application/json;charset=UTF-8',
'content-length': '206',
date: 'Fri, 12 Jan 2018 14:55:10 GMT' }
REQUEST reading response's body
REQUEST finish init function http://localhost:8080/exports/normal/INTERVIEWS_STATS/CSV
REQUEST response end http://localhost:8080/exports/normal/INTERVIEWS_STATS/CSV 200 { 'content-encoding': 'gzip',
connection: 'keep-alive',
'cache-control': 'no-cache, must-revalidate, no-transform',
'x-powered-by': 'Undertow/1',
server: 'WildFly/8',
'content-type': 'application/json;charset=UTF-8',
'content-length': '206',
date: 'Fri, 12 Jan 2018 14:55:10 GMT' }
REQUEST end event http://localhost:8080/exports/normal/INTERVIEWS_STATS/CSV
REQUEST has body http://localhost:8080/exports/normal/INTERVIEWS_STATS/CSV 203
REQUEST emitting complete http://localhost:8080/exports/normal/INTERVIEWS_STATS/CSV
[200 OK, 478B, 2.5s]
3⠄ ReferenceError in test-script
4⠄ ReferenceError in test-script
└ Get one export XLSX
GET http://localhost:8080/exports/normal/INTERVIEWS_STATS/CSV REQUEST { headers:
{ 'SA-requested-room': 'brand1.superlocal.com',
Authorization: 'Bearer 00c39dcf-ed6f-4625-b443-9deb6c8d9d28',
'User-Agent': 'PostmanRuntime/7.1.3',
Accept: '*/*',
Host: 'localhost:8080' },
url: 'http://localhost:8080/exports/normal/INTERVIEWS_STATS/CSV',
method: 'GET',
jar:
RequestJar {
_jar: CookieJar { enableLooseMode: true, store: { idx: {} } } },
gzip: true,
useQuerystring: true,
followRedirect: true,
followAllRedirects: true,
encoding: null,
lookup: [Function: bound lookup],
agentOptions: { keepAlive: true },
callback: [Function] }
REQUEST make request http://localhost:8080/exports/normal/INTERVIEWS_STATS/CSV
REQUEST onRequestResponse http://localhost:8080/exports/normal/INTERVIEWS_STATS/CSV 200 { 'content-encoding': 'gzip',
connection: 'keep-alive',
'cache-control': 'no-cache, must-revalidate, no-transform',
'x-powered-by': 'Undertow/1',
server: 'WildFly/8',
'content-type': 'application/json;charset=UTF-8',
'content-length': '204',
date: 'Fri, 12 Jan 2018 14:55:13 GMT' }
REQUEST reading response's body
REQUEST finish init function http://localhost:8080/exports/normal/INTERVIEWS_STATS/CSV
REQUEST response end http://localhost:8080/exports/normal/INTERVIEWS_STATS/CSV 200 { 'content-encoding': 'gzip',
connection: 'keep-alive',
'cache-control': 'no-cache, must-revalidate, no-transform',
'x-powered-by': 'Undertow/1',
server: 'WildFly/8',
'content-type': 'application/json;charset=UTF-8',
'content-length': '204',
date: 'Fri, 12 Jan 2018 14:55:13 GMT' }
REQUEST end event http://localhost:8080/exports/normal/INTERVIEWS_STATS/CSV
REQUEST has body http://localhost:8080/exports/normal/INTERVIEWS_STATS/CSV 203
REQUEST emitting complete http://localhost:8080/exports/normal/INTERVIEWS_STATS/CSV
[200 OK, 476B, 2.4s]
5⠄ ReferenceError in test-script
6⠄ ReferenceError in test-script
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
"ReferenceError in test-script" while running newman #595
I have a postman collection which runs fine from postman. In the script, i have some tests that do some basic validations on...
Read more >How To Fix Common Errors In Postman
Sometimes we get the error “ReferenceError: jsonData is not defined” while setting the global variable. To fix this, we need to define jsonData ......
Read more >Why do I get "ReferenceError: test is not defined"
Within my Google Script Project I got two GS files Code.gs and other.gs . code.gs looks like var globalSettings = {}; settings(); function ......
Read more >ReferenceError: "x" is not defined - JavaScript - MDN Web Docs
The JavaScript exception "variable is not defined" occurs when there is a non-existent variable referenced somewhere.
Read more >jQuery - Validation Test Suite - Willet Law Office
ReferenceError: $ is not defined at Object.<anonymous> (https://willetlaw.com/include/scripts/jquery-validation-master/test/rules.js:4:16) ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@BancarelValentin Closing issue due to inactivity. Feel free to reopen if you’re facing issues. 😄
Okay, it looks like you’re using postman-bdd to organize your tests. While globals are automatically picked up by the Postman app, Newman requires explicitly passing a file of global variables via the
-g /path/to/globals/file.json
flag. You can do this by exporting globals from the app, and passing the path to the exported file via-g
tonewman run
.Additionally, you’d also want to check out the all new
pm.test
interface, which has been documented here.