60 / 80 · 12 Programming for QA · Regex and Parsing← prev⊞ allnext →☰ Read as one page
7.9Practical Exercise
- Write a regex that extracts all error-level log lines from a log file and groups them by service name (text in square brackets like
[PaymentService]) - Parse a JSON API response and validate that all items have required fields, correct types, and no sensitive data
- Write a function that converts a HAR file (JSON format) into a summary: total requests, average response time, and error count
- Create a YAML-based test data file and write a pytest parametrize test that reads from it