Parameterization
Run the same test with many data sets.
What you'll learn
- Use one test for many cases.
- Reduce duplicate test code.
- See how data drives coverage.
Playwright AutomationlessonsJump to another lesson
Parameterization
Run the same test with many data sets.
Big Picture
One small picture can make this idea easier to hold.
Data driven
- One test runs many cases.
- New data is easy to add.
- The file stays short.
- Edge cases are clearer.
Many copy tests
- Same steps are copied a lot.
- Updates must be made many times.
- The suite gets noisy.
- Small mistakes repeat.
VerdictParameterization gives more coverage with less code.
How It Moves
Short steps make the flow easier to see.
List the cases
Write the inputs and expected results.
Feed the test
Pass each row into the same test.
Run many times
The same logic checks each data set.
Read the output
See which data case passed or failed.
Step By Step
This is the same idea, stretched across time.
- 1
Choose the data
Pick the values you want to test.
- 2
Write one test
Use the same steps for each case.
- 3
Run all rows
Let the test loop over the inputs.
- 4
Check coverage
Make sure the edge cases are included.
One Small Model
Think of this like a tiny card you can keep in your pocket.
Case grid
5 fieldsQuick Check
What is parameterization used for?
Map It
One more picture helps you see where this lesson matters most.
Coverage map
Best
One test, many rows
Good
Add one edge case
Weak
Copy the same test
Okay
A tiny data set