TestRigor - What is API - Bondar Academy

artembondar5 208 views 13 slides May 16, 2024
Slide 1
Slide 1 of 13
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13

About This Presentation

What is API, how does it work, typical API methods, status codes and implementation.


Slide Content

What is API

What is API? Weather API /DallasTemperature GET /CityTemperature POST URL: https://api.weatherapi.com/DallasTemperature Method: GET { “celcius”: 25, “fahrenheit”: 77 }

What is API? Weather API /DallasTemperature GET /CityTemperature POST URL: https://api.weatherapi.com/ CityTemperature Method: POST Body: {“city”: “New-York”} { “celcius”: 15, “fahrenheit”: 59 }

Types of API requests

HTTP response status codes

Client - Server Application API (Server) Web-browser (client) password username Log in

Client - Server Application API (Server) Web-browser (client) Welcome John123 Log in (click)

Client - Server Application API (Server) Web-browser (client) {} { “username”: “John123”, “password”: “Welcome” } Request Response {} { “firstname”: “John”, “lastname”: “Smith”, “age”: 35, }

Client - Server Application API (Server) Web-browser (client) {} { “username”: “John123”, “password”: “Welcome” } Request Response {} { “firstname”: “John”, “lastname”: “Smith”, “age”: 35, }

Functional End-To-End Testing API (Server) testRigor Web Application

Mocking API Response API (Server) testRigor Web Application Mock Response

Direct API call API (Server) testRigor Web Application

Summary: API - Application Programming Interface (black box) Method types: Get, Post, Put, Delete Typical request consists of: URL, Headers, Request Method, Request Body Status codes: 2xx (Success), 3xx (Redirect), 4xx (Client error), 5xx (Server error) TestRigor can mock APIs and interact with APIs directly