Library › Book 12 › File I/O and CSV/JSON
File I/O and CSV/JSON
17.1🔒OverviewTests need data from files, and tests produce data that must be saved to files. You load test credentials from a CSV. You parse CI pipeline…
17.2🔒Reading and Writing Text FilesEvery language provides built-in ways to read from and write to text files. The key concern in QA is always closing the file properly, even…
17.3🔒Parsing and Writing CSVCSV (Comma-Separated Values) is the most common format for test data files. You store test credentials, input parameters, and expected…
17.4🔒JSON Serialization and DeserializationJSON is the universal data format for APIs, configuration files, and test results. Every QA engineer must be fluent in reading, writing…
17.5🔒Combining File Operations: Loading Test Data and Writing ReportsReal QA workflows combine all three operations: load test parameters from CSV, run tests that produce JSON results, and write summary…
17.6🔒Exercises: Chapter 17Easy: Write a function in all three languages that reads a JSON file containing a list of test results and prints the name and status of…
17.7🔒Q&AQuiz: Chapter 171. Why should you use with open(...) in Python instead of manually calling f.close()? 2. What is the difference between JSON.parse() and…
17.8🔒Career Translation- Built a test data pipeline that loaded credentials and test parameters from CSV files, executed data-driven tests, and generated JSON…
17.9🔒Q&AInterview Depth CheckPrompt: Your test suite reads login credentials from a CSV file. Some rows have empty fields, which causes tests to fail with cryptic…