Questions tagged [postman-testcase]
283 questions
1
vote
1 answer
How can we add sleep time in postman test?
I am getting very big response(50k lines). I am getting 200 status and my test code written in Test tab starts getting executed before whole response loaded in postman.
In other words I and to add delay between success response and test starts.

shyam yadav
- 214
- 1
- 10
1
vote
1 answer
How can I count array elements in Postman tests
I have a json response like this and I would like to count how many Friend Groups are in MyFriends array (in my case I expect the code to return 7) :
I tried following but it throws tis error--
TypeError: Cannot read properties of undefined…

ninj
- 23
- 1
- 7
1
vote
1 answer
Can I show different results from an API using Postman
I have an dummy API which throws a response of 0 and 1, how can I get different responses with it using Postman. ie When I Hit the API if it throws a response of 0 it should show a different message and same goes with 1
I didn't know the approach

Ishan
- 11
- 1
1
vote
1 answer
Multipart/Realted API request in POSTMAN
I need to know the setup process of multipart/related file upload API request in POSTMAN.
I have the following details
API url :- https://apiq-jmqny-ste.azpre-api.net
json body :- {
"token" : "aqop094567",
"flow" : "work"
}
pdf file :-…

avidey
- 19
- 2
1
vote
1 answer
How can I change variable value in runtime in Postman test?
I'm trying to use postman for some basic API security tests and I have this URL:
http://example.com/api/v1/users/{{userID}}
{{userID}} is set to some user on site, and I want to set three tests that check if request is valid, if request has IDOR…

Daniel
- 269
- 1
- 4
- 11
1
vote
1 answer
Setting timeout for postman collections
I want to run the Postman collection with timeout enabled at the collection level.
Is this setting possible at the collection level in Postman?
I know that the timeout can be set per request using setTimeout(() => {}, 15000), but I could not find…

Sandeep Pandey
- 184
- 1
- 17
1
vote
1 answer
Postman query tests : pm expect to equal string like
I'm writing tests on Postman queries and I'm wondering if there were wildcards to test for equality on a string?
example :
pm.test("projectSheet should includes ", function () {
var jsonData = pm.response.json();
// jsonData.projectSheet…

louisBrochet
- 11
- 1
- 3
1
vote
1 answer
Postman API update collections
I am using Postman to test the Rest service with swagger 2.0 specs. I want to update the existing collection with multiple test cases with the new API specs.
Can anyone suggest a solution that will keep all existing requests and update the…

Noximus
- 11
- 2
1
vote
1 answer
Unable to extract a value from a JSON response to use as an enviroment variable in Postman
Pre Request:
//Create random number
let randomNum =
Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);
//Set Random # as the Random ID
pm.environment.set("randomNum", randomNum);
Body:
{ …

Jimmy
- 85
- 1
- 11
1
vote
0 answers
How to extract request payload variable to test from a GQL request payload in postman
I am writing tests in postman and i am having GQL POST request, in which i need to extract the GQL variables in test to validate and write script. But i cant able to extract the GQL variables.
Is there any methods available to extract GQL variables…

santhosh selvam
- 11
- 1
1
vote
1 answer
How to add parameter name to error message in Postman test
I'm writing some tests in Postman. When writing the error message, I must input manually the name of the variable that is being tested. Is there a way to avoid having to put it by hand? In some tests, there are 200 variables.
If something like…

bibu3344
- 163
- 2
- 10
1
vote
1 answer
How can I print the assertion with a value even if it get passed in Postman Api Testing
As a user, while executing the test cases created for the API Request, I'm expecting that it must show the value of the assertion even if the test cases pass.
For Example:
pm.test("User ID Should Exist", ()=>{
value =…

Muhammad Uzair
- 30
- 2
1
vote
1 answer
How do I regex a Content-Disposition header value in postman?
I am adding some tests into my postman API request and I was wondering how I can give a regex into the Content-Disposition header value, I have something like this but date is dynamic and just wanted to regex or do some other approach, any…

Cesar
- 49
- 1
- 3
1
vote
1 answer
how to access raw data in Postman(Request section)?
So I want to print out the client Name and the client Email as string values through the Postman console, but when I call the method I get a the array but with undefined values.
const res = pm.response.json();
const req = pm.request.toJSON();
let…

Mile Stanislavov
- 33
- 1
- 10
1
vote
1 answer
Getting Error " Data Should Be Object" while validating json schema
I have generated json schema for json schema tool. I have added that schema in variable. But during validation I am getting error that "Validate json Schema | AssertionError: expected data to satisfy schema but found following errors: data should be…

Shailesh Waghole
- 11
- 6