10 votes

Decoding JWT and testing results in Postman

I am not sure what you want to do, if you are able to extract the access_token then i believe that you know to use the test script session in postman Assuming you have the access_token stored in ...
PDHide's user avatar
  • 11.1k
7 votes
Accepted

How to verify response body as a test in postman

As @Mache says, you search for each value. var jsonData = pm.response.json(); pm.test("Verify Json values", function () { pm.expect(jsonData.data.id).is.to.equal(2); pm.expect(jsonData....
Decypher's user avatar
  • 252
6 votes

Printing Response body element in Test results in Postman

Assuming that you want to print a data from the response value var jsonData = pm.response.json(); var testmessage=jsonData._data[0].UserName //Dev_demo_82 pm.test(testmessage, function () { //...
Mohamed Sulaimaan Sheriff's user avatar
6 votes
Accepted

Writing Integration Tests programmatically vs using Postman for REST APIs

In overall it looks more a question regarding the code-based vs tool-based testing. And for the low-level, technology facing tests, such as integration tests, the code-based approach would give you: ...
501NotImplemented's user avatar
4 votes
Accepted

Assistance with a DELETE request in Postman

You need to provide token generated create Token API here in header under cookie field. and URL used in not as mentioned in API https://restful-booker.herokuapp.com/booking/{bookingID} Please ...
Sid's user avatar
  • 76
4 votes
Accepted

What are the pro's and con's of writing an API test automation framework at code level as opposed to using a tool

👍Pros of coding: You can easily integrate your test into CI process You can code any assertion logic you need in your tests You can utilize any library that is suitable for your chosen ...
Alexey R.'s user avatar
  • 11.6k
4 votes

How to Prevent Postman from sending a 'X-Deploy-Current' Header?

I believe this is not Postman issue. You should check what proxy are you using since the header is likely added there (after the request is leaving your Postman app). I tested Postman with Wiremock ...
Alexey R.'s user avatar
  • 11.6k
4 votes

What is the simplest way to rewrite Postman requests to C#

ReSharper is an Visual Studio IDE Plugin for C# by JetBrains. This won't help you much unless you want to write everything from scratch. Postman has the ability to generate code snippets for various ...
beatngu13's user avatar
  • 2,132
4 votes

Printing Response body element in Test results in Postman

Mohamed's step will allow you to do what you wanted, but if you are trying to debug something then postman already have the postman console for this purpose. so just use console.log() in the ...
PDHide's user avatar
  • 11.1k
4 votes

Writing Integration Tests programmatically vs using Postman for REST APIs

I used to write integration tests in Postman and after a couple of tens of requests, it became very difficult to maintain. Mostly because: accessing other resources like a DB was hard it was hard to ...
pavelsaman's user avatar
  • 4,548
3 votes
Accepted

How to send double quotes in postman csv data file

This is interesting, Newman and the collection runner are behaving differently. I have raised a bug on postman for this : https://github.com/postmanlabs/postman-app-support/issues/8024#issue-...
PDHide's user avatar
  • 11.1k
3 votes
Accepted

Consume POST request data to GET and DEL requests

This what the Postman variables do, Assuming that your response data is: { name: "something" user:{ id:"12" } } in the test script section, add below command let jsonData = JSON....
PDHide's user avatar
  • 11.1k
3 votes

How to export single API request with body in Postman so it can be imported

There is no direct option to export a single request from Postman. You can create and export collections. Here is a link to help with that. https://learning.postman.com/docs/getting-started/importing-...
IAmMilinPatel's user avatar
3 votes
Accepted

Postman - flags for different requests on different environments?

Newman has an option to select the environment you want to use, the flag -e Then, you can run newman run mycollection.json -e serviceAEnv to run the suite with the environment for service A. Then ...
João Farias's user avatar
  • 10.9k
3 votes

API Testing on production - what requests shouldn't test?

The answer depends on many other factors including the infrastructure. Even POST requests can create unwanted changes in production DB so GET is mostly the only safe method, investigate if this is ...
PDHide's user avatar
  • 11.1k
3 votes

Should i learn SOAP API or Rest Assured API Testing?

Don't focus too much on tooling. Tools will go out of fashion. Perhaps not this year, not in 2 years, but definitely a few times during your career life (provided you are not at the end of it, but ...
pavelsaman's user avatar
  • 4,548
3 votes
Accepted

How to verify particular values in JSON response - Postman

You can create a Postman test: pm.test("Checking wardNames", () => { const responseJson = pm.response.json(); pm.expect(responseJson[0].wardName).to.eql(Unit1); pm.expect(...
João Farias's user avatar
  • 10.9k
3 votes

What is the difference between Bearer token and API key authorisation in Postman API testing?

API testing requires careful consideration of authorization, which is an important aspect of the process. When it comes to authorizing a client to access an API, there are two common ways of doing so: ...
IAmMilinPatel's user avatar
2 votes

API testing Using Postman

Well it is an era of API Testing, Rest APIs in particular. I would recommend you to know the basics of Restful before you proceed to testing of different sorts. Some basics that you need to learn ...
Rohan Kalia's user avatar
2 votes

Should I test the created data after using Post Https Requests from Postman?

Practically saying when you do end to end testing, we have to validate database after POST operation(NOT always) to make sure that the ORM layer works fine. If the question is YES or NO, then I ...
Kshetra Mohan Prusty's user avatar
2 votes
Accepted

Adding session tokens to HTTP request with Postman

Add the following code to the "Tests" script for your authentication request. This script is executed upon receipt of the response. Modify the parts in <> to match the response given. var ...
VanderLinden's user avatar
2 votes

Web Service Testing Site

Try https://www.mockable.io There is a free plan that will allow you to build your own REST and Soap services and that will be enough to practice your interaction trials.
Alexey R.'s user avatar
  • 11.6k
2 votes

How to verify response body as a test in postman

To expand on the answer from @decypher Grouped tests will fail if only one test fails Individual pm.tests will create a higher number of tests in the reports But you can add a try/catch for each check ...
w4dd325's user avatar
  • 121
2 votes
Accepted

Print API response in "Test results" tab in Postman

Please try without parsing, Like below var body = JSON.parse(responseBody); var content = responseBody; tests["Response Body"+content]= body.length != 0
Sandeep Chandra Sekhar's user avatar
2 votes
Accepted

Schema Validation in Postman

Hi you should first parse the schema to json, else it will be considered as empty data in some cases. The correct code is as below: let jsonData = JSON.parse(responseBody); schema = JSON.parse(...
PDHide's user avatar
  • 11.1k
2 votes

Testing REST - submitting a web-form. Identifying why the server responses with 500 for some emails and for some - 200

Your testing is good. You are considering different possibilities and conducting experiments to see what happens. That is great. I would continue that process. Here are some thoughts for you to ...
Michael Durrant's user avatar
2 votes

API Management Tool Recommendation

For functional API testing you can consider using SoapUI, it provides unlimited workspaces/projects and immense features list even for open-source free version including assertions, mocks, scripting, ...
Dmitri T's user avatar
  • 13.5k
2 votes

Collection Variable is not being assigned

Problem THe send requests work asynchronously and hence get resolved only at the end, so to avoid this, use set time out, Whichever functions that use the specific collection variable, wrap it with ...
PDHide's user avatar
  • 11.1k
2 votes
Accepted

Exposing Postman Global variables as Jenkins Choice Parameters

https://github.com/postmanlabs/newman#newman-options This gives the entire command-line options for Newman so you can use --global-var "<global-variable-name>=<global-variable-value>" to ...
PDHide's user avatar
  • 11.1k
2 votes

Postman PUT returns success, but parameters are null in response body

Welcome. You need to read the documentation in detail, it shows an example of a request body for PUT method: { "name":"test1", "salary":"1123", &...
pavelsaman's user avatar
  • 4,548

Only top scored, non community-wiki answers of a minimum length are eligible