Platform

Solutions

Resources

Platform

Solutions

Resources

Platform

Solutions

Resources

Blog

Keyword Driven vs Data Driven Testing: Key Differences

Rishabh Kumar

Published on

eBook CTA Background
RECOMMENDED RESOURCES

The Ultimate Enterprise Guide To Agentic Testing

AI agents can write, fix and triage your tests at scale. See how to use them in QA while keeping people in control of everything that ships.

Get the eBook โ†’

Enterprise guide to agentic testing
eBook CTA Background
RECOMMENDED RESOURCES

The Ultimate Enterprise Guide To Agentic Testing

AI agents can write, fix and triage your tests at scale. See how to use them in QA while keeping people in control of everything that ships.

Get the eBook โ†’

Enterprise guide to agentic testing
eBook CTA Background
RECOMMENDED RESOURCES

The Ultimate Enterprise Guide To Agentic Testing

AI agents can write, fix and triage your tests at scale. See how to use them in QA while keeping people in control of everything that ships.

Get the eBook โ†’

Enterprise guide to agentic testing
eBook CTA Background
RECOMMENDED RESOURCES
Enterprise guide to agentic testing

The Ultimate Enterprise Guide To Agentic Testing

AI agents can write, fix and triage your tests at scale. See how to use them in QA while keeping people in control of everything that ships.

Get the eBook โ†’

Table of contents

Lorem ipsum

Lorem ipsum

Lorem ipsum

Lorem ipsum

Lorem ipsum

Data driven testing and keyword driven testing both came from the same frustration: test automation that was slow to write and painful to maintain. They just tackle different parts of it.

Data driven testing keeps the test steps the same and runs them with lots of different data. Keyword driven testing turns common actions into reusable building blocks, so people who don't code can put tests together. Many teams combine the two in a hybrid framework.

Both work well, but traditionally they've needed a lot of framework building and upkeep before anyone writes a useful test. In this guide, we'll explain each approach with examples, compare them side by side, show the hybrid approach, look at the challenges, and cover how plain English testing tools change the picture.



Keyword Driven vs Data Driven Testing at a Glance


Data Driven Testing

Keyword Driven Testing

Main idea

Same steps, run with many sets of data

Reusable actions, assembled into tests

What gets reused

The test logic

The keywords (actions)

Where data lives

Outside the test, in CSV, Excel, JSON or a database

Usually as parameters next to each keyword

Who builds the framework

Automation engineers

Automation engineers build the keyword library

Who writes tests

Engineers write the scripts, and anyone can add data

Testers and analysts assemble keywords without code

When the app changes

The script needs updating

The keyword's code needs updating, and tests using it stay the same

Best for

Checking one flow with many inputs, like user types, boundaries and locales

Large suites built by mixed-skill teams, who need consistent steps



What is Data Driven Testing?

Data driven testing is an approach where the test steps stay the same, and the data changes. One test runs many times, once for each set of data, so you can check different inputs, user types and scenarios without copying the test.

Part

What It Is

Example

Test logic

The actions the test performs

Go to the login page, enter details, click Sign in, check the result

Test data

The values used in each run

Usernames, passwords, expected messages

Separation

Logic and data are kept apart

Steps in the test file, data in a CSV

How Data Driven Testing Works

  1. Write the test steps without any fixed values.

  2. Put the test data in a separate file or database.

  3. The framework reads each row and runs the test once per row.

  4. Results show which rows passed and which failed.

Data Driven Testing Example

Here's the test data for a login test, with four scenarios:

CSV (login_data.csv)





And the test logic, written once:

Python (pytest and Playwright)

import csv
import pytest

def load_rows():
    with open("login_data.csv") as f:
        return list(csv.DictReader(f))

@pytest.mark.parametrize("row", load_rows())
def test_login(page, row):
    page.goto("https://shop.example.com/login")
    page.get_by_label("Email").fill(row["username"])
    page.get_by_label("Password").fill(row["password"])
    page.get_by_role("button", name="Sign in").click()
    assert page.get_by_text(row["expected_result"]).is_visible()
import csv
import pytest

def load_rows():
    with open("login_data.csv") as f:
        return list(csv.DictReader(f))

@pytest.mark.parametrize("row", load_rows())
def test_login(page, row):
    page.goto("https://shop.example.com/login")
    page.get_by_label("Email").fill(row["username"])
    page.get_by_label("Password").fill(row["password"])
    page.get_by_role("button", name="Sign in").click()
    assert page.get_by_text(row["expected_result"]).is_visible()
import csv
import pytest

def load_rows():
    with open("login_data.csv") as f:
        return list(csv.DictReader(f))

@pytest.mark.parametrize("row", load_rows())
def test_login(page, row):
    page.goto("https://shop.example.com/login")
    page.get_by_label("Email").fill(row["username"])
    page.get_by_label("Password").fill(row["password"])
    page.get_by_role("button", name="Sign in").click()
    assert page.get_by_text(row["expected_result"]).is_visible()
import csv
import pytest

def load_rows():
    with open("login_data.csv") as f:
        return list(csv.DictReader(f))

@pytest.mark.parametrize("row", load_rows())
def test_login(page, row):
    page.goto("https://shop.example.com/login")
    page.get_by_label("Email").fill(row["username"])
    page.get_by_label("Password").fill(row["password"])
    page.get_by_role("button", name="Sign in").click()
    assert page.get_by_text(row["expected_result"]).is_visible()

One test, four runs, four scenarios, and no repeated code. Adding a fifth scenario means adding a row, not writing a test.

For a deeper dive into this approach on its own, read our guide to data driven testing.



Benefits of Data Driven Testing

Benefit

Why It Matters

Lots of coverage from one test

For example, 10 products, 5 payment methods and 3 delivery options give 150 combinations from a single checkout test

Easy to update data

Change the data without touching the test, so business users can help maintain it

Less code

Write the steps once, and run them as many times as you need

Clear results

You can see exactly which data combinations fail

With that many possible combinations, it helps to choose which ones to test. Pairwise testing can cut thousands of combinations down to a few dozen rows that still cover every pair of values.



What is Keyword Driven Testing?

Keyword driven testing turns common test actions into reusable keywords, like "Log In", "Search For Product" or "Check Message".

Testers build tests by putting keywords in order and filling in their values, without writing code.

Part

What It Is

Keywords

Reusable actions, like "Open Login Page", "Log In" or "Check Message"

Test cases

Sequences of keywords, with values for each

Keyword library

The code behind each keyword, written by engineers and hidden from testers

How Keyword Driven Testing Works

  1. Engineers build a library of keywords for common actions.

  2. Testers write test cases by listing keywords and their values.

  3. The framework runs each keyword in order.

  4. When the app changes, engineers update the keyword's code, and the test cases stay the same.

Keyword Driven Testing Example

Here's what a keyword library might look like, written by engineers:

Python (Robot Framework keyword library)

from robot.api.deco import keyword
from playwright.sync_api import sync_playwright

class ShopKeywords:

    @keyword("Open Login Page")
    def open_login_page(self):
        self.page.goto("https://shop.example.com/login")

    @keyword("Log In As")
    def log_in_as(self, email, password):
        self.page.get_by_label("Email").fill(email)
        self.page.get_by_label("Password").fill(password)
        self.page.get_by_role("button", name="Sign in").click()

    @keyword("Message Should Be")
    def message_should_be(self, text):
        assert self.page.get_by_text(text).is_visible()
from robot.api.deco import keyword
from playwright.sync_api import sync_playwright

class ShopKeywords:

    @keyword("Open Login Page")
    def open_login_page(self):
        self.page.goto("https://shop.example.com/login")

    @keyword("Log In As")
    def log_in_as(self, email, password):
        self.page.get_by_label("Email").fill(email)
        self.page.get_by_label("Password").fill(password)
        self.page.get_by_role("button", name="Sign in").click()

    @keyword("Message Should Be")
    def message_should_be(self, text):
        assert self.page.get_by_text(text).is_visible()
from robot.api.deco import keyword
from playwright.sync_api import sync_playwright

class ShopKeywords:

    @keyword("Open Login Page")
    def open_login_page(self):
        self.page.goto("https://shop.example.com/login")

    @keyword("Log In As")
    def log_in_as(self, email, password):
        self.page.get_by_label("Email").fill(email)
        self.page.get_by_label("Password").fill(password)
        self.page.get_by_role("button", name="Sign in").click()

    @keyword("Message Should Be")
    def message_should_be(self, text):
        assert self.page.get_by_text(text).is_visible()
from robot.api.deco import keyword
from playwright.sync_api import sync_playwright

class ShopKeywords:

    @keyword("Open Login Page")
    def open_login_page(self):
        self.page.goto("https://shop.example.com/login")

    @keyword("Log In As")
    def log_in_as(self, email, password):
        self.page.get_by_label("Email").fill(email)
        self.page.get_by_label("Password").fill(password)
        self.page.get_by_role("button", name="Sign in").click()

    @keyword("Message Should Be")
    def message_should_be(self, text):
        assert self.page.get_by_text(text).is_visible()

And a test case written by a tester, using those keywords:

Robot Framework





Some teams write keyword tests in a spreadsheet instead, with one row per step:

Step

Keyword

Value 1

Value 2

1

Open Login Page



2

Log In As

jane@example.com

CorrectHorse1!

3

Message Should Be

Welcome back, Jane


Benefits of Keyword Driven Testing

Benefit

Why It Matters

More people can write tests

Testers and analysts can build automated tests without programming

Easy to read

Tests read like a list of plain instructions, so stakeholders can follow them

Reuse across tests

One keyword, like "Log In As", can be used in hundreds of tests and across projects

Simpler upkeep

When the app changes, you update one keyword, not every test that uses it

Common Keyword Driven Testing Tools

Tool

Notes

Robot Framework

Open source and widely used, with libraries for web, mobile, API and database testing

Katalon Studio

Built-in keywords, with a low-code editor and scripting

TestComplete

Keyword tests alongside scripted tests, strong on desktop apps

Custom frameworks

Many teams build their own keyword layer on top of Selenium or Playwright



The Hybrid Approach: Keywords and Data Together

Many teams combine both approaches. Keywords handle the actions, and external data drives the values. One keyword-based test can then run once for every row of data.

Part

Role

Keyword library

Reusable actions, like Log In, Search Product, Add To Basket and Check Out

Test cases

Sequences of keywords

Test data

External data that fills in the keyword values

Framework

Runs the keywords once for each data row

Hybrid Example

Robot Framework supports this directly with test templates. The keyword is written once, and each line below it is a set of data:

Robot Framework

*** Test Cases ***
Login Scenarios
    [Template]    Login Should Show Message
    jane@example.com       CorrectHorse1!    Welcome back, Jane
    jane@example.com       wrong-password    Invalid email or password
    unknown@example.com    CorrectHorse1!    Invalid email or password
    ${EMPTY}               CorrectHorse1!    Email is required

*** Keywords ***
Login Should Show Message
    [Arguments]

*** Test Cases ***
Login Scenarios
    [Template]    Login Should Show Message
    jane@example.com       CorrectHorse1!    Welcome back, Jane
    jane@example.com       wrong-password    Invalid email or password
    unknown@example.com    CorrectHorse1!    Invalid email or password
    ${EMPTY}               CorrectHorse1!    Email is required

*** Keywords ***
Login Should Show Message
    [Arguments]

*** Test Cases ***
Login Scenarios
    [Template]    Login Should Show Message
    jane@example.com       CorrectHorse1!    Welcome back, Jane
    jane@example.com       wrong-password    Invalid email or password
    unknown@example.com    CorrectHorse1!    Invalid email or password
    ${EMPTY}               CorrectHorse1!    Email is required

*** Keywords ***
Login Should Show Message
    [Arguments]

*** Test Cases ***
Login Scenarios
    [Template]    Login Should Show Message
    jane@example.com       CorrectHorse1!    Welcome back, Jane
    jane@example.com       wrong-password    Invalid email or password
    unknown@example.com    CorrectHorse1!    Invalid email or password
    ${EMPTY}               CorrectHorse1!    Email is required

*** Keywords ***
Login Should Show Message
    [Arguments]

That gives you the reusability of keywords and the coverage of data driven testing in one test.



Challenges with Traditional Frameworks

Challenge

What Happens

Time to build

Before anyone writes a useful test, someone has to design the framework, build the data or keyword layer, and add logging and reporting. That can easily take several months

Ongoing upkeep

The framework itself needs maintaining, as languages, libraries and browsers change

Waiting for new keywords

Testers can only use the keywords that exist. When they need a new one, they wait for an engineer

Fragile locators

Keywords still rely on fixed locators underneath. When the app changes, someone updates the keyword code

Learning the framework

New team members need time to learn the keyword names, conventions and data set-up

If you're building or reviewing a framework, our guide to test automation framework design covers the decisions that matter most.



How Plain English Testing Changes the Picture

Plain English testing tools take the ideas behind both approaches, reusable steps and separate data, without needing a custom framework.

Plain English Steps Instead of a Keyword Library

Instead of choosing from a fixed list of keywords that someone had to build, testers write each step in plain English. Here's the same login test:

Plain English (Virtuoso QA)





There's no keyword library to build or maintain, and testers aren't limited to the keywords that already exist.

Data Tables Instead of Custom Data Wiring

The values starting with $ come from a data table attached to the test, so the same steps run once per row, just like the CSV example earlier. There's no framework code to read files or map columns to steps. You can also describe the data you need in plain English and have AI generate realistic rows, including edge cases like empty fields and special characters.

Reusable Checkpoints Instead of Keywords

Common steps, like logging in or checking out, can be saved as reusable checkpoints and used across many tests. Update a checkpoint once, and every test that uses it gets the change, which is the same benefit keywords give you, without building a library first.

For more on building tests from shared, reusable pieces, read our guide to reusable test cases.

Fewer Broken Tests When the App Changes

In a keyword framework, if a button's ID changes from submit_btn to checkout_button, every keyword that uses it breaks until an engineer updates it. Plain English tools find elements by their label, position and context, so many changes don't break tests at all. When one does, the tool suggests a fix for your team to approve.



When to Use Each Approach

Approach

Use It When

Data driven framework

Your app is fairly stable, your team is comfortable coding, and you mainly need to run the same flows with lots of data. It's also a good fit if you already have a framework that works

Keyword driven framework

You have engineers to build and maintain the keyword library, your app doesn't change much, and you want testers to assemble tests from a consistent set of steps. It's also a good fit if your keyword library already covers what you need

Hybrid framework

You need both reusable steps and lots of data variations, and have the engineering time to support both

Plain English testing platform

Your app changes often, you want testers and analysts to write tests without waiting for new keywords, you test many applications, or you'd rather not build and maintain a framework yourself

There's no single right answer. Teams with a mature, working framework don't need to throw it away. But if you're starting from scratch, or your framework is taking more time to maintain than it saves, it's worth comparing the effort with a platform that does the same job out of the box.



How Virtuoso QA Helps

What You'd Get from a Framework

How Virtuoso QA Does It

Readable, reusable steps (keyword driven)

Tests written in plain English, with StepIQ suggesting the next step, and reusable checkpoints shared across tests

Many runs with different data (data driven)

Data tables attached to tests, plus AI-generated test data from a plain English description

Updates in one place

Change a shared checkpoint once, and every test using it is updated

Resilience to UI changes

Elements found using several clues, with suggested fixes your team approves

No framework to build

Reporting, CI/CD integration and cross-browser runs across 2,000+ browser and OS combinations are built in

Moving from an existing framework

GENerator converts existing Selenium tests into plain English



Related Reads

Keyword Driven vs Data Driven Testing FAQs

What's the main difference between keyword driven and data driven testing?

Can you use keyword driven and data driven testing together?

Which is better, keyword driven or data driven testing?

Is Robot Framework keyword driven or data driven?

Do I need to code for keyword driven testing?

Where should test data be stored for data driven testing?

See what your next release looks like with Virtuoso

Book a walkthrough on your applications and your workflows. Bring a requirement, a user journey, or a brittle Selenium script, and watch the loop run on something you recognise.

See what your next release looks like with Virtuoso

Book a walkthrough on your applications and your workflows. Bring a requirement, a user journey, or a brittle Selenium script, and watch the loop run on something you recognise.

See what your next release looks like with Virtuoso

Book a walkthrough on your applications and your workflows. Bring a requirement, a user journey, or a brittle Selenium script, and watch the loop run on something you recognise.

Virtuoso QA is establishing the standard of proof for software releases. Its governed QA loop turns business requirements into tests for any browser-based application: AI proposes, a deterministic engine executes, a person approves what matters, and every decision leaves evidence.

Trust Center

AICPA

SOC

WAVE STRONG PERFORMER

@ Copyright 2026 SpotQA, Creators of Virtuoso QA

Virtuoso QA is establishing the standard of proof for software releases. Its governed QA loop turns business requirements into tests for any browser-based application: AI proposes, a deterministic engine executes, a person approves what matters, and every decision leaves evidence.

Trust Center

AICPA

SOC

WAVE STRONG PERFORMER

@ Copyright 2026 SpotQA, Creators of Virtuoso QA

Virtuoso QA is establishing the standard of proof for software releases. Its governed QA loop turns business requirements into tests for any browser-based application: AI proposes, a deterministic engine executes, a person approves what matters, and every decision leaves evidence.

Trust Center

AICPA

SOC

WAVE STRONG PERFORMER

@ Copyright 2026 SpotQA, Creators of Virtuoso QA