Parameterization

Run the same test with many data sets.

Playwright Automation Module 3 Lesson 4
10 min read

What you'll learn

  • Use one test for many cases.
  • Reduce duplicate test code.
  • See how data drives coverage.

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.

3

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. 1

    Choose the data

    Pick the values you want to test.

  2. 2

    Write one test

    Use the same steps for each case.

  3. 3

    Run all rows

    Let the test loop over the inputs.

  4. 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 fields
Case 1:"empty input"
Case 2:"valid email"
Case 3:"too long text"
Shared step:"submit form"
Result:"Pass or fail"
Each row reuses the same steps with new data.

Quick Check

Question 1 of 10 correct

What is parameterization used for?

Map It

One more picture helps you see where this lesson matters most.

Coverage map

Coverage value
High

Best

One test, many rows

Good

Add one edge case

Weak

Copy the same test

Okay

A tiny data set

Low
Few casesMany cases
Data count
Parameterization gives more coverage without more copy-paste.

Final Quiz

Question 1 of 30 correct

What does parameterization do?