Questions tagged [postman-testcase]

283 questions
1
vote
1 answer

POSTMAN - How to set environment value for nested object in single request?

Im trying to sign few fields and send the signed field as another field in an request.that is inside of an nested object..Im trying to setEnvironmentvariable but it is setting the same value again.. { "id" : "1234", "ref" : "REF05", "details": [ …
1
vote
1 answer

Postman - How to get the parameters and values ​passed in the url (Query Params) for validation?

I need to get the parameters and values ​​passed in the url (Query Params) to validate these values. The parameter and value are passed like this in the url: /Data?value=4
1
vote
1 answer

Test a big body response in JSON on Postman

I have a body response on Postman that return this for me: [ { "key": "Dateline Standard Time", "value": "(UTC-12:00) International Date Line West" }, { "key": "UTC-11", "value": "(UTC-11:00) Coordinated Universal Time-11" }, { …
1
vote
0 answers

How to solve StringComparison.OrdinalIgnoreCase and LINQ issue?

Here's the code: controller: //POST api/substances [HttpPost] [ServiceFilter(typeof(ValidateNameExistsAttribute))] public ActionResult CreateSubstance([FromBody]SubstanceSaveDto dto) …
1
vote
1 answer

How to validate a Response with numbers in Postman

I got the following response - Pre-Note added with PIN (1368) The PIN number will not be the same always, so, how can I write a re-runnable test to validate it?
Manu
  • 23
  • 4
1
vote
2 answers

How do I search for a particular object within an array of JSON objects using postman

How do I query for a particular BusStopCode from within a JSON object in a JSON array "value": [ { "BusStopCode": "01012", "RoadName": "Victoria St", "Description": "Hotel Grand Pacific", …
1
vote
1 answer

How can you grab responses from the body in postman whenever the key contains '@' or ':'

In Postman I am trying to grab the value from keys which contain '@' at the beginning and ':' in the middle of them. I can get the first one (@id) by using jsonData['@id'] For example: let jsonData = pm.response.json(); pm.test("Body contains…
1
vote
2 answers

Run multiple images/files with iteration data variable using Postman Runner or Newman

Scenario I have a POST request API which accepts Image or File. As shown below: I can select an image from the Request body as a form-data but, here I can select one image at a time. But I want to upload multiple images or files as a form-data…
1
vote
1 answer

saving arrays in one call and use it in another call in postman

I am trying to use chain request feature in postman. Here is my first request: As you see I am trying to save configs as an array to use it in another request. Apparently post man save the array in env vars as an strings. So here I need to use the…
1
vote
1 answer

How to provide expected JSON (response) using external text file in Postman

I am making a collection where after hitting each API, I need to validate the response (in JSON) against my expected JSON which I have extracted after manually hitting the API first. I already know that I can pass this expected JSON as any other…
1
vote
2 answers

In postman, how can i check if the values in the response is same as that of the request irrespective of case or the order for an array?

I have a request similar to { "Name":"123", "Age":"1234", "Phone":"12345", "RequestedABC":{"XYZ":"111abc","Qwe":"222abc","ZXC":"333def"} } Response is { "Name": "123", "AllowedABC": { "XYZ": "111abc", "ZXC":…
Rohith R Nair
  • 43
  • 1
  • 10
1
vote
1 answer

Postman test automation - verify json array response

I have a simple api GET request and the response body is just like below. I'm using Postman API automation and I want to validate the response and check whether below conditions are met using a Postman test. Response array size should always be…
Prabodha
  • 520
  • 1
  • 6
  • 19
1
vote
1 answer

Is there any way to run a test script after each request in Postman Collection?

I am working on a Restful API that creates a new token after each request. So, in Postman I am refreshing my token environment variable after each request in Tests like following: pm.test("Successfull Login Test", function () { …
1
vote
0 answers

How to get collection request name at newman cli postman

I want to save my all response file with their request name. So I am finding a solution where I get the request name. Newman CLI is a command-line tool to run the postman collection but I read out all documentation and not get any solution for the…
1
vote
2 answers

How to verify a particular text in response body using postman

Response Body { "message": "Hi I am 'lakshmi' from 'India'" } The text lakshmi is provided in pre-request script and I need to verify the same in the response. I don't want to verify like this below Var message = "Hi I am 'lakshmi' from…
Lakshmi
  • 17
  • 1
  • 6