Questions tagged [postman-testcase]
283 questions
0
votes
1 answer
How to test the status code when key headers are valid
I wanted to test the status code if all the key headers are valid.
All I know is the Content-type key. I'm getting an error when doing this to other key headers.

Danbi
- 1
0
votes
1 answer
Not able to publish the test results from newman during Postman integration with Azure pipeline
I'm trying to integrate my Postman collection with Azure pipeline using Newman for CI and generate the test results, I'm able to run the tests in Azure Pipeline but not able to publish the results.
Following are the steps I followed-
1.Import…

Sayali
- 51
- 1
- 1
- 7
0
votes
1 answer
Test case in postman
I am learning to write Test cases in postman and my Request body looks like this
{
"PhoneNumbers": [
"string"
],
"EmailAddresses": [
"string"
],
"FirstName": "string",
"LastName": "string",
}
And my test case is like…

anita
- 7
- 2
0
votes
1 answer
Parsing nested, "named" objects in Postman
I am trying to parse JSON data returned in a Postman test for the first time but the complexity of my payload is causing parsing issues: how can I get to the "stage-guid" field in
{
"Workflow": {
"com.mycom.MyWorkflow": {
…

Dr Dave
- 550
- 1
- 6
- 22
0
votes
1 answer
Is there a way in postman to assert multiple comma separated values in single column of csv file?
I am new to post man and I want to parse a csv file having comma separated values in single column for implementing assertion. Is there a way to implement this?
Note: The values I want to assert needs to be fetched from CSV file and will be dynamic…

Nahor
- 83
- 1
- 7
0
votes
1 answer
How to validate dynamic values in postman
I want to validate some mandatory fields in my JSON response body. Until now I am using a static way of testing by using hardcoded values something like this
json_response = JSON.parse(responseBody);
x=json_response
pm.expect(x).to.equal("abc");…

Jiya Mishra
- 3
- 2
0
votes
1 answer
Identify string value in jSON based on FieldName only with array index changes every time
How to search whole jSON output from postman and get only string values from newFields array and save in variable based on fieldName only
fieldName": "TX.Sessionval.cost
Have to update Test case everytime since array index changes for newField…

GPs
- 67
- 1
- 10
0
votes
2 answers
How to store leading zero in csv in order to pass postman script
I am running scripts which compares API response with values from CSV file,
Undelying CUSIP Number 1 | AssertionError: expected '24936205' to deeply equal '024936205'
I receive above error as i am not able to store leading 0 in csv.
Any…

Coder
- 3
- 2
0
votes
1 answer
Postman - String match resulting in assertion error
I am trying to validate a JSON response with data from csv file.
Both contain same values but still test fails.
Here is the error on collection runner
Address Line 1 Validation 0 | AssertionError: expected '9 DRAGSTAFF AVE' to equal '9 DRAGSTAFF…

Coder
- 3
- 2
0
votes
1 answer
How do I sort a json using a time stamp field within the json file in Postman?
I am new to Postman, I have a API call which gives me the output as a json. In the "Test", I get the JSON by "bodyData = JSON.parse(responseBody);"
The JSON file has got timestamp fields example "executedDate": "2020-11-26T09:45:27.000Z". I would…

Sreedhar Reddy
- 3
- 2
0
votes
1 answer
Error while executing Postman Test Script
I am writing the Postman test cases. I am getting an error from following test-case
pm.test("Response to have expected data", function () {
pm.expect(documentIdArray).to.have.members(['5868', '4', '5874']);
});
There was an error in evaluating…

Harjinder Singh
- 23
- 1
- 10
0
votes
1 answer
Is there a way to verify a value given in request is present in response or not in postman?
I have given a parameter in request(eg:date=2020-03-12) I need to verify the same date is present in response or not, by not giving the value(2020-03-12) directly in script. Because this date is dynamic and will be changed often. So I need to check…

Immanuel
- 49
- 3
- 8
0
votes
1 answer
Execute a request a given number of times (postman)
Related to:
https://stackoverflow.com/questions/36157105/postman-how-to-make-multiple-requests-at-the-same-time#:~:text=Just%20create%20a%20runner%20with,to%20bring%20up%20multiple%20instances.
but I need to make the same request a given number of…

Sebi
- 4,262
- 13
- 60
- 116
0
votes
1 answer
how to run endpoint test with different variable values in Postman?
This would seem to be a simple question, but not sure how to best set it up.
I have a few test cases for the same endpoint.
I want to just pass different values for the various {{variables}}.
I know I can use pm.globals.set('..') and other ways to…

dcsan
- 11,333
- 15
- 77
- 118
0
votes
1 answer
How to grab variable from one API that is within a nested Array response body?
How to grab the contentID and content title add it within an array and have it used in the URL of API 2
if i use the code below for section title and sectionid it is working because it is not in an nested array but for the contentid and contenttitle…

shahbaz
- 145
- 2
- 16