Questions tagged [web-api-testing]

Web API testing is the functional testing of HTTP based services.

Testing can include verification of domain related behavior and/or compliance with HTTP specified application behavior as described in RFC 7231.

787 questions
57
votes
5 answers

How to add authorization header in POSTMAN environment?

I'm testing bunch of API calls using POSTMAN. Instead of adding authorization header to each request, can I make it as a part of POSTMAN environment? So, I don't have to pass it with every request.
asp
  • 649
  • 1
  • 6
  • 10
25
votes
8 answers

REST API test cucumber steps best practice

Trying to write up cucumber feature steps for REST API test. I am not sure which approach is better: Given I log in with username and password When I add one "tv" into my cart And I check my cart Then I should see the item "tv" is in my…
ccy
  • 1,385
  • 6
  • 17
  • 27
22
votes
5 answers

Postman - how to loop request until I get a specific response?

I'm testing API with Postman and I have a problem: My request goes to sort of middleware, so either I receive a full 1000+ line JSON, or I receive PENDING status and empty array of results: { "meta": { "status": "PENDING", …
17
votes
1 answer

How to share data between beforeAll / beforeEach and tests in Jest?

We use jest to test our API and have quite complex scenarios. We use the beforeAll functions to set up general helper variables for each test and sometimes to set up tenant separation, in other cases we use the beforeEach functions to set up tenant…
peter
  • 14,348
  • 9
  • 62
  • 96
14
votes
8 answers

Invalid character in header content ["Host"] Postman

When i try to test api with localhost:[port] it gives the invalid character in header ["Host"] console error. I am using dotnet core webApi. I cross checked the CORS configuration from api end it is fine. The issue is on the Postman side. Postman…
Atif Khattak
  • 149
  • 1
  • 1
  • 6
13
votes
5 answers

How to pass Query String Parameters in GET url using Rest Assured?

How to pass Query String Parameters in GET url using Rest Assured? URL is: http://example.com/building My Query Strings are…
12
votes
2 answers

How to handle URL with special characters present in password in Postman?

I have the following format in URL. http://username:password@test.nabin.com/some/url Here password is something like qDTA*$X)ME/74. When I directly use this password in URL, then the postman does not respond. How should I proceed testing this…
Nabin
  • 11,216
  • 8
  • 63
  • 98
11
votes
1 answer

What is the major difference between SoapUI and Postman? & which one to prefer for testing REST APIs?

We are analysing the best tool to test REST APIs. Also considering in mind, integration with TFS.
Amitesh Marwah
  • 111
  • 1
  • 1
  • 4
11
votes
2 answers

Prompting for user input in Postman

How can I ask for user input in Postman scripts? I am using Postman 4.8.3, Chrome app. I have used environment variables in most cases, but for a particular case I need user to provide input for each run (I am not running collection. Instead want to…
TechiRik
  • 1,893
  • 6
  • 27
  • 37
11
votes
2 answers

before/afterAll() is not defined in jasmine-node

I'm trying to use the methods beforeAll and afterAll of jasmine, to create a suite of tests with frisby.js, because actually, frisby doesn't have a support for this methods. So, this is what I'm trying to do: var frisby =…
10
votes
1 answer

In Karate how we can collaboratively work along with BA to automate business scenarios

While using Karate we were able to do most of the validations for web services, we were able to successfully integrate Karate with Selenium webdriver and do DB assertions using java classes. For DB we returned the results sets as list by converting…
Sree
  • 331
  • 1
  • 4
  • 14
9
votes
2 answers

How to add bearer token to retrofit request in Java

Hi Im trying to add a bearer token to a retrofit call in java, but i cant seem to pass it. Currently Im logging in with one method and this creates a bearer token and im trying to add the token to the Get Call, but its just returning a 401 error,…
FearghalQA
  • 255
  • 1
  • 2
  • 11
9
votes
2 answers

JEST - why mock api calls?

I'm getting familiar with JavaScript testing, and may be missing a point or two related to mocking api calls. Every tutorial I have found mocks api calls when doing unit or integration testing - example: https://jestjs.io/docs/en/tutorial-async I…
9
votes
2 answers

How to update Postman collections when new requests get updated by developer to the api

I have my API's document in Swagger which have different endpoints or request. I used the swagger.json link from my API's in Swagger to import them to Postman as collections and then add test cases there. But I am confused on one thing that if the…
codingninja
  • 91
  • 1
  • 1
  • 4
9
votes
2 answers

REST API Testing: How to get response using Google Chrome developer tools?

I'm very new to API testing. I'm trying to make use of Google Chrome's developer tools to understand and explore this subject. Question 1: Is it possible to get the response (possibly in JSON format) of a simple GET request using chrome developer…
1
2 3
52 53