Playwright with Python #31 - Data-Driven API Testing Using CSV File | Stop Hardcoding Payloads!

Learn Playwright Python API testing with CSV data-driven approach! In this tutorial, master how to read CSV files in Python and dynamically create test paylo...

Playwright with Python #31 - Data-Driven API Testing Using CSV File | Stop Hardcoding Payloads!
Testing Funda by Zeeshan Asghar
79 views โ€ข Jun 11, 2026
Playwright with Python #31 - Data-Driven API Testing Using CSV File | Stop Hardcoding Payloads!

About this video

Learn Playwright Python API testing with CSV data-driven approach! In this tutorial, master how to read CSV files in Python and dynamically create test payloads for robust automation.
๐ŸŽฏ In this video, you'll learn how to make your API automation tests truly data-driven by reading user data directly from a CSV file instead of using static payloads. We'll write a custom Python function using the csv module's DictReader to convert CSV data into a list of dictionaries, then loop through each record to dynamically build request payloads for the create user API.
This is a must-know skill for QA engineers and automation testers โ€” data-driven testing is widely used in real-world projects to test multiple scenarios efficiently without duplicating code.
๐Ÿ“Œ KEY TOPICS COVERED:

Reading CSV files using Python's csv module
Creating a custom read_users function with DictReader
Looping through CSV records to build dynamic payloads
Mapping CSV columns (name, email, gender, status) to API payload fields
Running data-driven tests across multiple records
Validating assertions for each CSV row

โฑ๏ธ TIMESTAMPS:
00:00 Introduction & Recap of Previous Tutorial
00:25 Reviewing the Previous Static Payload Approach
00:42 Plan: Reading Data from CSV File
00:59 Exploring the users.csv File Structure
01:24 Importing the CSV Module
01:48 Creating the read_users Function
02:23 Opening the CSV File in Read Mode
03:14 Returning Data as a List Using DictReader
04:07 Calling read_users and Passing the File Path
05:07 Looping Through CSV Data to Build Payload
06:06 Mapping CSV Fields to Payload (name, email, gender, status)
07:18 Running the Data-Driven Test
07:50 Test Results Across Multiple CSV Records
๐Ÿ“ข If this tutorial helped you, hit LIKE, SUBSCRIBE, and drop a COMMENT below! Turn on notifications so you never miss an automation testing tutorial. Your support helps us bring more career-boosting content for QA engineers and automation testers!

#playwrightpython #datadriventesting #automationtesting #playwrighttutorial #csvtesting #apitestingtutorial #qatestingjobs #pythonautomation #softwaretesting #learncoding #playwrightapi #pythontutorial #qaengineer #apitesting #testautomation #csvfilereading #pythonprogramming #automationtester #codingtutorial #techeducation

๐Ÿ”” Subscribe for FREE Software Testing Tutorials โ†’ https://www.youtube.com/c/TestingFunda

==================================
๐Ÿš€ WHAT YOU'LL LEARN ON THIS CHANNEL
==================================
โœ… Manual & Automation Testing
โœ… Selenium, Cypress, Playwright & Appium
โœ… API Testing with Postman
โœ… Performance Testing with JMeter
โœ… Java & Python for Testers
โœ… Agile, SDLC, STLC & Interview Prep

==================================
๐Ÿ“š FREE TUTORIAL PLAYLISTS
==================================

๐Ÿ”น Selenium Tutorials (Free)
https://www.youtube.com/watch?v=5hyEnZT9AkQ&list=PLBw1ubD1J1UjP1rZMbU8NSh2ajE12Yjjf

๐Ÿ”น JMeter Performance Testing (Free)
https://www.youtube.com/watch?v=s33Bqz0vAUw&list=PLBw1ubD1J1UgVniCSUlg_LKRzlF11CZZB

๐Ÿ”น Postman API Testing (Free)
https://www.youtube.com/playlist?list=PLBw1ubD1J1UgVniCSUlg_LKRzlF11CZZB

๐Ÿ”น Java Programming for Testers (Free)
https://www.youtube.com/watch?v=C8HRfmJ_ZZQ&list=PLBw1ubD1J1UjGNxe10eY-H7e9cQ12Qk_l

๐Ÿ”น Cypress Automation Testing (Free)
https://www.youtube.com/watch?v=OvCLwh5vN8g&list=PLBw1ubD1J1Ujws5XLs7BGJqQkQVpJtmBJ

๐Ÿ”น Agile Testing Series (Free)
https://www.youtube.com/playlist?list=PLBw1ubD1J1Uif-cFY6BJRbjc3Ah9bKpSd

๐Ÿ”น Animated Software Testing Videos (Free)
https://www.youtube.com/watch?v=jRcsuCrQI_s&list=PLBw1ubD1J1UhnuUX3Kd5OP5r9qaDHie-T

==================================
๐Ÿ”— CONNECT WITH US
==================================
๐Ÿ“บ YouTube โ†’ https://www.youtube.com/c/TestingFunda

==================================
โš ๏ธ DISCLAIMER
==================================
All content is for educational purposes only.

#SoftwareTesting #AutomationTesting #Selenium #QA #ManualTesting #Postman #JMeter #Cypress #JavaTesting #APITesting #PerformanceTesting #QAEngineer #SDET #TestingTutorials #FreeTutorials #2026

Tags and Topics

Browse our collection to discover more content in these categories.

Video Information

Views

79

Likes

4

Duration

9:01

Published

Jun 11, 2026

Related Trending Topics

LIVE TRENDS

Related trending topics. Click any trend to explore more videos.

No specific trending topics match this video yet.

Explore All Trends