Questions tagged [postman-testcase]

283 questions
2
votes
0 answers

Add automatic tests to Postman Collection when exporting Swagger Collection

I'll go step-by-step. I have a node js program that refers to a swagger specification json file and converts it into a Postman importable collection file (also in JSON format). I am doing this using "swagger2-postman-generator" npm library. For a…
user1710861
  • 413
  • 6
  • 9
2
votes
1 answer

Postman test to check the number of decimal places

I would like to test that the number of decimal places returned by a field in the response is equal to 5. Not sure if using regex is the best solution but this is what I have so far which does not seem to work: pm.test("Check number of decimal place…
kz500
  • 21
  • 2
2
votes
1 answer

How to prevent new Test script ids generation in postman tests

When I export my postman tests after some changes in some tests, all test script ids in postman collection are changed. It is hard for me to change every id in a big collection before commit. How to avoid ids changing?
2
votes
1 answer

Postman Test with comparison to global variable

I want to orchestrate two requests in Postman. The first response will give me a variable. I save this id to a global variable id. In Postman this variable is usually accessible via {{id}}. Then I send a second request with this id (like GET…
2
votes
1 answer

Asserting postman random variable

I have a collection of simple API requests, and I'm running into an issue with one of the tests I've created. I have a request which creates some content, and I use the built-in '$randomMACAddress' variable to generate a random name for the list I'm…
Jason
  • 75
  • 1
  • 1
  • 8
2
votes
1 answer

Postman Schema Validation using TV4

I'm having trouble validating a schema in Postman using tv4 inside the tests tab - it is always returning a true test, no matter what I feed it. I am at a complete loss and could really use a hand - here is my example JSON Response, and my…
2
votes
0 answers

How to test rate limit for an API in postman by writing a test script?

I tried writing simple code in Tests tab of a API request in postman tool to test rate limit of an API. Basically want to verify if n is X-Rate-Limit and if I call same API n+1 no. of times does it throw rate limit exceeded status code in response.…
anonymous-explorer
  • 365
  • 1
  • 12
  • 26
2
votes
2 answers

How to read a JSON object with a full-stop in the name using POSTMAN?

I have a problem trying to check a JSON value in the response body using POSTMAN because the JSON object name has a full-stop in it Usually a JSON response body would be something like this: { "restapi": "Beta", "logLevel": "INFO" } So normally we…
2
votes
2 answers

How can i export a request or collection into excel directly from Postman?

I want request present in collection into excel. How can I export a collection to excel using Postman? Since I am unable to find any solution.
2
votes
2 answers

How to compare JSON body object name (Keys) itself?

I am very new to Postman. I want to compare JSON body object response. json_response = JSON.parse(responseBody); x=json_response.counter pm.expect(x).to.equal("400"); It gives me 400 value of that corresponding 'counter' (or '400' Value of Key…
kishorK
  • 453
  • 2
  • 7
  • 16
2
votes
2 answers

POSTMAN ENV FILE, different values for the same object

currently, I am running my postman scripts using Newman by the following command Newman run [filename] .json -e [env name] I have the env.json file set up, but for one of my variables there could be more than 1 input and I would like to control…
Milad
  • 27
  • 5
2
votes
1 answer

Get redirected URL from Postman

I'm currently migrating my old website to a new one and I have just created some url redirect rules to redirect old links to their pages on the new website. In order to test these redirect rules I'm using Postman but I can't find any way of getting…
1
vote
1 answer

Validate data with Postman

Friends, From this situation I am taking the following error response: FAIL Check value is either 1 or 2 | TypeError: Cannot read properties of undefined (reading 'gender') FAIL Check value fullName | TypeError: Cannot read properties of undefined…
Staulik
  • 19
  • 1
  • 5
1
vote
1 answer

Exported from Chrome Extension of Talend API Collection and import into Postman is not working?

I have Exported API Collection from Talend API Collection(chrome-extension://aejoelaoggembcahagimdiliamlcdmfm/index.html#requests) Chrome Extension for API Tested and try to import into Postman is not working?. Any one have idea how to make it work…
Mohamed Abbas
  • 111
  • 1
  • 4
1
vote
0 answers

Are POST requests with Content-Disposition header supported in Postman?

I did some research both in the Postman GUI (auto-completion for request headers which does not offer "Content-Disposition") and in learning.postman.com/docs and there is no mention of "Content-Disposition" request header. I am using this request…
1 2
3
18 19