API Automation Testing Syllabus – Python + Pytest
1. Introduction
- What
is API Automation Testing?
- Differences
between Manual and Automated API Testing
- Why
Automate API Testing?
- Overview
of Python Libraries for API Testing:
2. Setting Up the API Automation Project
- Installing
Required Packages
- Creating
a Basic Project Structure
- Introduction
to Sample APIs
- Writing
the First GET API Test using requests
- Validating
Status Code, Response Body, and Headers
3. Working with Parameters
- Sending
Query Parameters in GET Requests
- Using
Path Parameters in API URLs
- Passing
Headers and Payload
- Using
Environment Variables / Config Files for Dynamic Values
4. Validations in API Responses
- Validating:
- Status
Codes
- Response
Headers
- Response
Body
- Extracting
Values using:
- Dictionary
Access
- jsonpath-ng or custom functions
- Response
Assertions using assert and pytest
5. POST, PUT, PATCH, DELETE Requests
- Creating
Payloads using Python Dictionaries / JSON Files
- POST
Requests with Payloads
- PUT
and PATCH Requests to Update Data
- DELETE
Requests and Validating Responses
- Creating
Reusable Utility Functions for API Calls
6. Authentication and Authorization
- Overview
of Different Authentication Types:
- Basic
Auth
- Bearer
Tokens
- OAuth2
(basic concept only)
- Passing
Auth Headers in Requests
7. Serialization and Deserialization
- Working
with JSON Data in Requests and Responses
- Converting
JSON Response to Python Object
- Serializing
Python Object to JSON for Payloads
8. Pytest-based Automation
Framework
- Building
an API Test Framework using pytest
- Folder
Structure:
- Creating
Config Files for Environment Setup
- Grouping
Tests
- Adding
Reusable Fixtures
- Parametrizing
Tests with Test Data
- Skipping,
Failing, and Tagging Tests
9. Logging and Reporting
- Generating
HTML Reports
- Capturing
Request & Response Logs for Debugging
10. Running and Organizing Tests
- Organizing
Tests into Modules and Packages
- Configurations
- Creating
Custom CLI Commands for Execution
- Creating
Test Suites using Markers / Categories
- Test
Execution:
- Full
suite run
- Module-specific
run
- Test-specific
run