Questions tagged [postman-testcase]

283 questions
0
votes
0 answers

Cannot POST /api/blogcategory

I'm creating a mern stack blog app and I'm following a youtube video for backend api post but got stuck here.The get method is working fine but post method is not working and i'm unable to figure it out. Help me to find the mistakes i'm doing here?…
0
votes
1 answer

Postman: Test to check the number of response body lines

looking at the provided screenshot In the response at Pretty section, I have 36 lines of data. I would like to write a test for this request, which would check if the response body lines were 36 each time the request is run. What would be your…
0
votes
0 answers

AssertionError: expected undefined to deeply equal true

"Below code through the error:" pm.test("Your test name", function () { var jsonData = pm.response.json(); pm.expect(jsonData.inStock).to.eql(true); });
0
votes
1 answer

Postman script - Calculate sum and return the value to 2 decimal places

In a Postman test script, I am trying to get a specific value using a simple calculation and return that value, in order to use it in a subsequent parts of the request. let expectedDpay = temp.payPlanPremiumAmount; let expectedDpay =…
Lilac
  • 580
  • 1
  • 7
  • 25
0
votes
1 answer

Comparing integers in different JSON response Arrays with Postman test

I have 2 different JSON responses from 2 different GET methods from postman. I am trying to write a test to compare them. the first response is specificYield [ [ "2020-11-30T00:00:00Z", 50.701604514154944 ], [ …
B Ahern
  • 11
  • 4
0
votes
1 answer

Postman test extract integer variable from object of arrays

I am trying to create postman tests for an API. The response I am getting from post man is in a json form. It looks like an Object of arrays. { "389": [ [ "2021-04-30T00:00:00Z", 16.130089309443093 ] ], "390": [ [ …
B Ahern
  • 11
  • 4
0
votes
0 answers

The postman collection passes when we execute the run manually but it fails often in the monitoring section of postman

The issue is with the monitors. The postman collection passes when we execute the run manually but it fails often in the monitoring section of postman. I would like to determine the cause.
0
votes
1 answer

Postman Test | I want to save id in variable but i need to split that id

I am getting the following id in response "id": "FsuJ6ld97vVC2mkh5bGo5K-us|0000001". I always need to take value before | and ignore the rest of values after us. also value is not consistent, sometimes it's 24 values and sometimes 23. I have used…
0
votes
0 answers

Create a loop to send requests to API until all results are returned in Postman

I am writing a test script in Postman 9 and want to call the API and page the API response until all results are returned. For this API, pagination works by passing the next page id in the API request parameters until the has more flag is set to…
user3165854
  • 1,505
  • 8
  • 48
  • 100
0
votes
0 answers

Array in postman for test script

I am creating test script for automation in postman.I want to create array. I have response, which has multiple id's String. How can create array for to verify ids.
0
votes
1 answer

Test if json list has max lenght of 5 POSTMAN, JS

I gotta assert that a json list can have a maximum of 5 elements. My problem is how do I do this in postman framework. The list can have either 1 or 5 elements, this is dynamic, i gotta verify it never has more than 5. var data =…
Ovr99
  • 11
  • 4
0
votes
1 answer

Get line of error/assertionError in postman

So I m getting an assertion error in postman, and the error looks like this: There was an error in evaluating the test script: AssertionError: expected undefined to be a string But i have 300 assertions for this API, and is virtually impossible to…
Ovr99
  • 11
  • 4
0
votes
1 answer

Reusing test loops in Postman

I am have the following loop which triggers a the same Get Request until an order is processed and the correct status is set. The problem is that I have to use the same snippet on different scenarios and each time there is a change i have to change…
0
votes
1 answer

Postman tests send multiple requests

I want to make a postman request that returns a list of IDs. The returned list can contain 1 or multiple IDs. In tests section i want to use these returned IDs to make new requests. Is it possible to send requests from tests section in for loop and…
LAL
  • 21
  • 3
0
votes
2 answers

How to run the "set a Global Variable" only once in POSTMAN and use them for all the keys In the collection

I have a request body as follows, Here I need the keys "id", "sys2Acct" and "shortName" to be set to a same value. NOTE: the request body has huge number of key's, I somehow want to assign the same number (i.e random) to the mentioned keys in this…