portman
portman copied to clipboard
How to include common functions and headers that are sent for all requests via postman collection to the new collection generating via Portman
First of all should appreciate the great efforts that have gone in getting Portman to this shape. How can I include common functions and headers that are sent for all requests in the global postman collection to the new collection that is getting generated via Portman.
Should we manually add to the collection which will be time consuming
hi @techwizardg
Did you sort it out? Reading your question, It sounds like you are looking to use the "collectionPreRequestScripts" from https://github.com/apideck-libraries/portman#portman---globals-property
yes and the same helped and hence closed. Thanks @thim81
@thim81 I am facing similar issue. prerequisite scripts which are present in file script1 are not getting added in postman collection even after doing below things. I have added below code in portman-cli-options.json "globals": { "stripResponseExamples": true, "collectionPreRequestScripts": [ "file:C:\Users\ravindra.dumpa\Downloads\script1.js" ], and using below command "portman --cliOptionsFile C:\Users\ravindra.dumpa\Downloads\examples\portman-globals\portman-cli-options.json -l C:\Users\ravindra.dumpa\Downloads\ums.yaml -o D:\newums3.postman.json -t -b http://172.25.49.214/mobiquitypay --globals.collectionPreRequestScripts"
Guide me how to solve this issue
hi @Ravindra1510
Looking at your CLI command you are mixing parameters. In the Example - Global Config you can find a working example.
Hi @thim81 thanks for the help. now I am able to add scripts in collection level pre requisite script tab but i want to add scripts for request level pre requisite script tab. Can you help me on this
hi @Ravindra1510
There is this option for: https://github.com/apideck-libraries/portman?tab=readme-ov-file#portman---operationprerequestscripts-properties
Hi @thim81 : I were able to add collection level scripts and request level scripts but when i am generating variance tests my request level scripts are not importing also can you please suggest how to configure tokens in portman-config.crm.json [For example i want to use bearerToken for all my variance tests]
hi @ehlmnq and @techwizardg
Where you able to get your config working as expected? If yes, feel free to close this. if no, can you share where you are stuck, so the community can perhaps assist.
Closing due to inactivity.
Since there hasn't been any feedback for the past months, I assume the issue has been resolved. If you're still experiencing problems, please feel free to reopen this issue or create a new one. Thanks for your contribution!