-1

I want to automate web api testing, but I am a beginner to automation. I have list of REST API's which I want to automate. Can someone please suggest from where should I start? Can I use Selenium to automate?

Saket
  • 11
  • 1
  • 1

2 Answers2

2

You can write test cases with postman and test all your web apis.

Like test response time, status code, content-type and much more.

here is one simple example. Type this in the test tab of postman.

var contentTypeHeaderExists = responseHeaders.hasOwnProperty("Content-Type");

tests["Has Content-Type"] = contentTypeHeaderExists;

if (contentTypeHeaderExists) {
    tests["Content-Type is application/json"] = 
      responseHeaders["Content-Type"].has("application/json");
}

Advanced use cases includes grouping and saving different types of APIs by their modules types.

for more details check this blog

Jay Modi
  • 3,161
  • 4
  • 35
  • 52
1

You can use any of the external libraries out there to automate the REST APIS. Below are few of them you can use:-

  1. REST Assured Library
  2. HTTP Client

Once you are done with the API Automation using external libraries you can club the same with Selenium to develop Integration Tests which will perform some work on FrontEnd using Selenium library and it can also perform some Backend work using any of the aforesaid clients.

Paras
  • 3,197
  • 2
  • 20
  • 30