Questions tagged [postman-testcase]

283 questions
0
votes
1 answer

Postman Test getting request body named "email" problem

i have these properties on my postman request body { "firstName": "QA", "lastName": "Test {{agent_phone_number}}", "email": "qatest-{{agent_phone_number}}@mail.com" } and i'm trying to get the request body on the Tests tab and set…
thekucays
  • 568
  • 3
  • 9
  • 32
0
votes
2 answers

How to verify array length for postman test

I have json response showing 4 values (image showing 3) for this object companies[0].salesReps How to verify postman test for total no of Sales employee and print their names on…
GPs
  • 67
  • 1
  • 10
0
votes
1 answer

Test with postman or django-rest-framework test

i have a doubt about the tests in drf, did you use the test drf or postman? or maybe you do both because in postman you create the documentation and and you can do a constant monitoring, what thing do you recommend me?
0
votes
1 answer

Postman Tests: There was an error in evaluating the test script

I am testing the application and face this error, I want to include this error in my script but I don't know-how. This error happens because I write the wrong variable name on the body, and is also part of the process to test. I want to do something…
0
votes
0 answers

Postman check if response value is greater than or equal to another value

I have a request in which a filter is added in the URL itself. Let the filter be named minAgeDecimal. In the response i should get listings with a variable AgeDecimal which is greater than or equal to the requested MinAgeDecimal value. Sample…
0
votes
2 answers

In postman tests, how can i assert the response values with one of multiple values when the input parameter can be empty?

I have an input parameter called IsFruit which can be either 0 or 1. If the value is 0, the response should return fruits with FruitsYN value as N. Similarly if value is 1, FruitsYN should be Y. If this parameter has no values, response can have…
0
votes
1 answer

Postman: how to parse xml within CDATA inside XML host response?

I've read multiple resources here and elsewhere, but I failed to resolve my problem. I send a POST request in XML to a host having CDATA made of another XML "request", and the response has the same structure. From the nested XML response inside…
0
votes
1 answer

Postman Object hasOwnProperty Tests

I am trying to evaluate a JSON, so that I can know if the properties are correct, I have the following code: var data = JSON.parse(responseBody); Object.keys(data).forEach(key => { if(data.hasOwnProperty(key)){ console.log("Have all…
DastanAli
  • 15
  • 7
0
votes
1 answer

How to get postman tests to Fail - mine are always passing?

I'm writing a simple Postman test that even checks if true == false but it always passes. What am I doing wrong? You can see the green light here: Just a single test on its own without the wrapper function will fail [good!], but that doesn't seem a…
dcsan
  • 11,333
  • 15
  • 77
  • 118
0
votes
1 answer

How to use variable from one request in another request test body in postman test body?

I want to execute 3 requests (api1, api2 and api3) one after the other. I want to make api3 request dependent on values(type:int) of api1 and api2. In api1 request test body: var data = pm.response.json(); var count1 = data.length; In api2 request…
0
votes
1 answer

How can I validate Postman API response contains the String mentioned CSV file

When running a Postman requests through Collection runner by passing the values contain in a CSV file for the input parameters, how can I validate each response contain the String text mentioned in the expected value column in this CSV file. I also…
0
votes
1 answer

Postman: Read a csv file placed in aws using Postman?

How can I read a csv file placed in aws using Postman ? I am able to get list of files and folders places in aws using aws url: https://s3.amazonaws.com/partnertrackingconfigurationdev/?list-type=2 access key, secret key and session token. But, I…
0
votes
1 answer

How to URL encode a dynamic email variable in Postman?

i just wanna know if there is a way to url encode an dynamic email variable in postman? basically i want random names in all parts of the email for my collection run. For example test1@abc.com , ybc@asd.com.(which can be solved by using the email…
0
votes
0 answers

How to access object property inside array?

The code below, I wrote in Postman. I would like to get the created_at date which shows in the picture I attached. But it keeps giving me the current response date. const moment = require("moment") console.log(pm.response.json(0)); let…
0
votes
0 answers

Postman - how to get all attribute values and setEnvironment them?

In my body return: { "status": "OK", "msg": "", "data": { "events": { "1-7396679c-4597-4253-9b8e-f135017c791c": { "event": "verbose" }, "2-ee86609a-5c86-4662-a94d-9d4c0e3c836d":…