API Test Automation with Robot Framework and Database Validation.
Overview
This project automates API testing for a payment and ticketing system using Robot Framework with Python. The tests cover transaction flows, payment status checks, exception handling, and data integrity validation between the API layer and the database.
The key differentiator in this project is the database validation layer — after every API call, the test doesn't just trust the response. It queries the database directly and verifies that what the API returned is actually what was saved.
What to Verify
The focus is data integrity between the API response and the database for a payment and ticketing system:
- API response. Status code, title, message, and transaction fields.
- API-to-database consistency for each transaction: vehicle type, ticket number, payment status, ticket status, and payment method.
- Exception handling and data-integrity scenarios. Confirming that what the API returns is actually what is stored in the database.
How to Verify
- Built with Robot Framework + Python using a keyword-driven design (response verification, database validation, and utility keywords).
- After each API call, the test takes the ticket number from the response, queries the database directly, and compares the values side by side.
- Database access is written with SQLAlchemy; two generic query functions (by ticket number, by entity ID) accept a field_name parameter, so verifying a new field never requires a new function.
- Credentials and API keys are never hardcoded. They are read from environment variables through a dedicated module, with logs suppressed during retrieval so sensitive data never reaches the reports.
- A layered structure (resources, database utilities, credentials, custom libraries) lets each layer be updated independently.
Testing Stack