Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

Postman variables in query string don't get replaced #106

Closed
MopsiMauser opened this issue Jun 3, 2021 · 6 comments
Closed

Postman variables in query string don't get replaced #106

MopsiMauser opened this issue Jun 3, 2021 · 6 comments

Comments

@MopsiMauser
Copy link

Hello,

Postman variables in the query string don't get replaced when the request is invoked. I think the problem is that the placeholders for the variables are getting URL encoded within the conversion. I attached a Postman collection and the created k6 script.

Command Line: postman-to-k6 TestCollection.postman_collection.json -o TestCollection.js

Best Regards

TestCollection.js.txt
TestCollection.postman_collection.json.txt

@thim81
Copy link
Contributor

thim81 commented Jun 19, 2021

@MopsiMauser

I have made a PR to solve this unwanted encoding, more info on the origin of issue can be found in the PR #113

@rcrichton
Copy link

I have variables for both host and port in my postman collection. Could this be the reason those aren't getting replaced as well?

@thim81
Copy link
Contributor

thim81 commented Jul 21, 2021

@rcrichton The issue was related to the query string part which got incorrectly encoded.

For the definition of the host and port, you can use the available environment variable option /~https://github.com/grafana/postman-to-k6#environment-variables

By passing a postman environment config file, the variables will be inserted in the generated k6 script.

thim81 pushed a commit to thim81/postman-to-k6 that referenced this issue Jul 24, 2021
@thim81
Copy link
Contributor

thim81 commented Aug 18, 2021

For those experiencing the same issue, I have provided a forked NPM package version that contains a fix for the current issue:

Replace in your packages.json:

"dependencies": {
    "postman-to-k6": "^1.5.0"
  }

to

"dependencies": {
    "@apideck/postman-to-k6": "^1.6.0"
  }

This is a forked NPM package, to help overcome the issue. The current maintainers are quite overloaded by the acquisition of K6 by Grafana. By forking the repo & package, users can keep using new PR's & (security) fixes. At a later stage the changes can potentially be merged back in the original postman-to-k6 repo.

The changelog contains the differences between the original package & the forked version.

@MopsiMauser
Copy link
Author

@thim81 thank you for your effort!! I just tested it and it works now <3

@ppcano
Copy link
Collaborator

ppcano commented Nov 22, 2021

Apologies for the inactivity on this project.

Due to the inability to properly support this project, the k6 team has decided not to continue its development. The primary reason is that k6 scope has grown significantly with the launch of k6 extensions. The team is prioritizing extending k6 capabilities over the converters.

We suggest you post your issue at api-deck/postman-to-k6. The project is active and maintained on this fork.

@ppcano ppcano closed this as completed Nov 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants