π Book Management API Automation (Python)
π Overview
This project is an end-to-end API automation framework built using Python Requests to validate RESTful services. It focuses on testing book management workflows, including creating and deleting books via API endpoints.
The framework demonstrates real-world API testing practices, including configuration handling, data-driven testing, and response validation.
π οΈ Tech Stack
Python
Requests Library
MySQL (for test data handling)
ConfigParser (for environment configuration)
π― Features
β
End-to-End API testing (Create β Validate β Delete)
β
Data-driven testing using MySQL
β
External configuration using .ini file
β
Modular and reusable utility functions
β
Clean project structure for scalability
π Project Structure
Book-Management-API-Tests/
β
βββ API_MySql_E2E.py # Main E2E test script
βββ Utilities/
β βββ configuaration.ini # Config file (base URL, DB details)
β βββ requirements.py # Helper functions
β βββ __init__.py
β
βββ __init__.py
π Test Workflow
Connect to MySQL database
Fetch test data
Send API request to Add Book
Validate response
Send API request to Delete Book
Verify successful deletion
βοΈ Configuration
All environment details are stored in:
Utilities/configuaration.ini
Example:
[API]
base_url = http://example.com
[DB]
host = localhost
database = APIDevelop
user = root
password = root
βΆοΈ How to Run
1οΈβ£ Clone the repository
git clone https://github.com/avinashu199/Book-Management-API-Tests.git
cd Book-Management-API-Tests
2οΈβ£ Install dependencies
pip install requests mysql-connector-python
3οΈβ£ Run the script
python API_MySql_E2E.py
π Sample API Flow
POST β Add Book
GET/Response Validation
DELETE β Remove Book
π Key Learnings
API automation using Python Requests Handling database-driven test data Structuring a scalable test framework Managing configs using configparser π Future Enhancements Add Pytest framework Implement logging & reporting Add CI/CD integration (GitHub Actions) Add more CRUD test coverage
π¨βπ» Author
Avinash Uppalapati
β If you like this project
Give it a β on GitHub!