Questions tagged [postman-testcase]

283 questions
0
votes
1 answer

How can I extract object/key names from nested and varying JSON payload in a Postman Test script?

I am an old-school C++ programmer - trying to get to grips with Postman, JSON, REST APIs, etc, and struggling.. I am trying to write a Postman test to visualize some JSON response data - which I would like to show in a table format with some merged…
UNLseg
  • 1
  • 2
0
votes
1 answer

how to catch postman assertion error and store in a variable

i am using Postman and I have some tests(assertions) in my request. When any test fails, i get an error like the following:- AssertionError: expected response to have status code 400 but got 200 I want to store this exact error text in a string…
0
votes
0 answers

How to use Postman Share collection link from via JSON link to via API link?

Earlier I was sharing postman collection link from via JSON link on AzureDevops. But due to version upgrade in postman it is now showing via API link which uses access key. I tried using older version of postman but it is stuck at fetching…
0
votes
0 answers

create a postman workflow with pm.sendRequest by req name not working

here i am writing a test script after getting user details from get request if the user exist i am trying to delete it i already have a delete request named "deleteUser" with url:http://localhost:8000/delete/user but pm.sendRequest("delete user") is…
0
votes
2 answers

Postman test script - how to call an api twice to simulate 409 error

I am trying to run a few automated testing using the Postman tool. For regular scenarios, I understand how to write pre-test and test scripts. What I do not know (and trying to understand) is, how to write scripts for checking 409 error (let us…
0
votes
0 answers

How can I send different json responses for different request parameter values in postman?

I am trying to test my APIs in postman's mock server. I have an endpoint which returns a json with a few key value pairs. In my request I have some key value pairs in the json format. What I want to test is as follows Lets say if the request has a…
0
votes
3 answers

Comparing the entire response body by storing in one file and compare that file with current response in postman

I am doing automation script for Functional testing my query is Send the request and store the entire response body in one file. Again they send the request and get the new response. Compare the new response body with a stored response…
0
votes
0 answers

Simulate Merge Request in Postman

I have set up a Jenkins pipeline which runs in the event a merge request is made to my gitlab repo. How can I use Postman to simulate the merge request to essentially see that in the event a merge request is made, the pipeline will execute as it…
ddd
  • 17
  • 4
0
votes
0 answers

Postman training query in test collection

I have been doing the postman training. So, how to solve this error? I tried solving the error by checking each variable, query or something but nothing works.
0
votes
0 answers

Using Postman to test KOHA RestAPI but keep getting authentication failure

I have a problem working with Postman and Koha RestAPI to display desired input. I want to try GET request on Postman using this URL as endpoint: https://{KOHADomain}/api/v1/patrons?userid={userid}. What supposed to happen is the output should…
0
votes
0 answers

Postman: How to properly expand and assert response?

I have my assertion written like this: pm.expect(response.validations.Result).to.eql("valid"); With it I am trying to test if the Result is valid, But I am unsure how to get through the "0: {...}" level Postman considers it as undefined - "Check if…
chokachi
  • 7
  • 3
0
votes
1 answer

How to run the dependent request multiple times till the desired response is not achieved from request in test in Postman

I have Request A and Request B which I have to test in the Postman Test Condition for testing these API is that Success of Request A is depended on the response of the Request B When the request A is hit the response from the Request B send the…
0
votes
0 answers

How to retry a postman test if one of the expectations failed?

I am trying to add logic that reruns the test if one of the expects failed. Here is the code structure // if response is 200 then complete following checks pm.test("Response is 200", () => { pm.response.to.have.status(200); pm.test(`test1`,…
Null Null
  • 19
  • 5
0
votes
1 answer

how do I test my spring boot API in postman with have file and data(number,body,title)?

I want to test this Controller in postman: @PostMapping(value = "/create") public ResponseEntity> create( @RequestParam(name = "avatar", required = false) MultipartFile file, @RequestParam("data") String data, …
abdul wahid
  • 111
  • 2
  • 10
0
votes
0 answers

I need to assert the response I sent via pm.sendRequest()

I have created a POST request to generate a token for myself. Next, I wrote the code for assertion using pm.test() and its working. Following that, I sent another request via pm.sendRequest(). As a result of this request, I am receiving a response…