Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

empty globals file is generated when using --export-globals option #537

Closed
mykhaylo- opened this issue Aug 16, 2016 · 3 comments
Closed
Assignees
Milestone

Comments

@mykhaylo-
Copy link

Hi
My collection has the following code in one of the tests:

var token = postman.getResponseHeader("x-auth-token");
postman.setGlobalVariable("x_auth_token", token);

When I run the following command

newman run -r cli,html -e pub_env.json --bail --export-globals globals.json https://api.getpostman.com/collections/808581-9c4c8735-e0bc-cd88-16f7-b7600d75f416?apikey=$API_KEY

newman executes my collection successfully and generates globals.json file. But it is generated without any global variables while I expect "x_auth_token" to be there:

{
  "values": [],
  "_postman_exported_at": "2016-08-15T20:53:08.375Z",
  "_postman_exported_using": "Newman/3.0.1"
}

Please suggest.

@kunagpal
Copy link
Contributor

@mykhaylo- Thanks for reporting this issue! A fix for this bug has been added within Newman v3.1.0-beta.1.

Please re-try exporting your run variables after installing Newman with npm i -g newman@beta, and let us know if your issue has been resolved.

@mykhaylo-
Copy link
Author

@kunagpal many thanks. it works in v3.1.0-beta.1

@miguelC
Copy link

miguelC commented Nov 28, 2017

I am running into this issue with version 3.8.3 :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants