Hot answers tagged

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 ...
user avatar
  • 10.8k
5 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....
user avatar
  • 232
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 ...
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 ...
user avatar
  • 11.4k
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 ...
user avatar
  • 2,112
4 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: ...
user avatar
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-...
user avatar
  • 10.8k
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 ...
user avatar
  • 9,949
3 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 ...
user avatar
  • 11.4k
3 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 () { //...
user avatar
3 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 ...
user avatar
  • 10.8k
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 ...
user avatar
  • 4,338
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 ...
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.
user avatar
  • 11.4k
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
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(...
user avatar
  • 10.8k
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 ...
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, ...
user avatar
  • 12.6k
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 ...
user avatar
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 ...
user avatar
  • 10.8k
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 ...
user avatar
  • 10.8k
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", &...
user avatar
  • 4,338
2 votes
Accepted

AssertionError: verify response body as a test in postman

Just to add to the above answer , in JSON {} is a JSON object and [] is an Json array. So the JSON.parse just parses the response string into proper JSON. As the response starts with a {} you can ...
user avatar
  • 10.8k
2 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 ...
user avatar
  • 4,338
2 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 ...
user avatar
  • 10.8k
2 votes
Accepted

Search for minimum number of occurrences of a substring

I need to check if the “dna” contains at least 10 “Ngg” sites. That means if there are a minimum of 10 [acgt]gg sites (agg or cgg or tgg or ggg). How do I write a test for that? You need to first ...
user avatar
  • 4,338
2 votes

Search for minimum number of occurrences of a substring

I need to check if the “dna” contains at least 10 “Ngg” sites. That means if there are a minimum of 10 [acgt]gg sites (agg or cgg or tgg or ggg). How do I write a test for that? pm.test('length ...
user avatar
  • 10.8k
2 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(...
user avatar
  • 9,949
2 votes

How to validate nested array from JSON response using Postman?

You solution in the comment section: pm.test('Check nested Id data type', () => { _.each(pm.response.json().values, (topLevelItem) => { _.each(topLevelItem.values, (nestedItem) => { ...
user avatar
  • 4,338
1 vote

Testcase Python Request: 405 Error despite not accepting the certificates

405 shows that the specific HTTP Method is not supported for the specified endpoint. It have nothing to do with a certificate. You are using POST method on a .html file which most probably ain't ...
user avatar
  • 10.8k

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