Questions tagged [postman-testcase]
283 questions
0
votes
1 answer
In postman collection execution, Is it possible to access multiple data files per collection or access different rows in same iteration?
I'm running test cases using postman for different API calls. Running multiple REST APIs require different datafile. Also, I need to access different rows of the same datafile. Is there a way to implement this using postman?
I'm seeing a restriction…

viz
- 51
- 8
-1
votes
1 answer
Postman: How to dynamically validate JSON value without using a switch statement
I want to dynamically validate the value of JSON request parameters without the use of switch statement
I tried the code below which works fine but it is not optimized as I have to create a case for each field I am validating.
If there a way to…

Kunleyeye
- 3
- 1
-1
votes
1 answer
How to write Postman if/else statemen for schema
I am looking at some older Postman test scripts, and since I don't have much experience, I need help understanding this a bit better.
The following are in the test scripts
//schema validation
const schema201PostSuccess =…
-1
votes
1 answer
How to get the value of key from the body of Json response using Postman Test?
Hi Team I have response Json whose body is as below
{
"host": "telemarket-backend.val.io",
"ssl-client-verify": "NONE",
"x-request-id": "916633224df75cb3cd728631879612181761",
}
when I am writing test in Postman for the above body as…

jitendra gupta
- 47
- 2
- 11
-1
votes
1 answer
Postman giving 400 for pm.sendRequest
When I am running below send request from Postman - Tests, getting 400 bad request.
Could anyone tell me where I am wrong in sending the request?
let loginRequest = {
url: new_url,
method: 'POST',
headers: {
…

Manish Katepallewar
- 13
- 5
-1
votes
1 answer
OR Condition in Postman assertion
Hi I have the following assertion in postman but it is failing
pm.test("Body matches string", function() {
pm.expect(pm.response.text()).to.include('Success')
|| pm.expect(pm.response.text()).to.include('Request already…

Abhishek.k
- 1
- 3
-1
votes
1 answer
Is there any way to check if different formats of the same header is supported in postman tests?
I have requests that require a token. Its passed in the header for the request as a key value pair with the key being access_token and the value being its value. Now different formats of the access token needs to be supported. eg:…

Rohith R Nair
- 43
- 1
- 10
-1
votes
2 answers
API test | Validate Response
I have the below response body (json) I want to do the below checks
1) Check if 'id=5' exist

John
- 1
- 3
-1
votes
1 answer
JSON Validate check based on response from arrayElement
I wanted to check from the response format if status=AVAILABLE then arrayElement should return with roomTypeId else roomTypeId should not return for other status.
[
{
"status": "SOLDOUT",
"propertyId": "dc00e77f",
…

Sankar S
- 19
- 2
-2
votes
1 answer
how to open chrome to get some text box values from postman?
I am running API1 from postman but to run API2, would need to pass some values from API1 response to UI page & post submitting it there in UI, need to capture the value from UI text box and pass it to API2 request in postman.
So to do that, how to…

Shiv
- 13
- 4
-2
votes
1 answer
Extract data from json response in POSTMAN
How do I extract personReference from the json response in postman tool? I just wanted to extract the personReference & parameterized it in next level requests:
{
"result":…
-2
votes
1 answer
Postman test doesn't work after console log
As a newbie in Postman, I'm a bit confused trying to log the test step.
When console.log is commented - the test works fine:
But when I use console.log, it goes through all iterations, prints the value but falls on the next step
Any thoughts…

Pavel
- 1