Skip to main content
Automation
DEFINITION

What is Keyword-Driven Testing?

Keyword-driven testing is a test automation approach where test steps are represented as keywords (action words) in a table, abstracting the underlying automation code so that non-technical testers can design and maintain tests.

Free to start · 7-day trial on paid plans

IN DEPTH

In depth.

In a keyword-driven framework, each keyword maps to a reusable function. A test might read: Open Browser > Navigate To "https://app.com/login" > Enter Text "email_field" "user@test.com" > Click "submit_btn" > Verify Text "Welcome." The keywords are defined once in a library, and tests are composed by combining them in spreadsheets or structured files.

This approach bridges the gap between technical automation engineers and domain-expert testers who may not code. The automation team builds and maintains the keyword library, while QA analysts create test scenarios using familiar vocabulary. Tools like Robot Framework are built around this paradigm.

A keyword-driven framework typically has four layers. The bottom layer is the driver script that reads the keyword table and dispatches each action. The next layer is the keyword library, which defines what each keyword does in code (Click, Enter Text, Verify Element). Above that sits an object repository or locator file mapping logical names like "submit_btn" to actual selectors. The top layer is the test data, the spreadsheet or YAML file where testers compose scenarios from keywords and arguments.

Keyword-driven testing differs from data-driven testing in what is abstracted. Data-driven testing keeps the test logic in code and only varies the inputs across rows of a data table. Keyword-driven testing abstracts the actions themselves, so the test scenario lives entirely outside code. Hybrid frameworks combine both: keyword steps composed into scenarios, with each scenario parameterised across data rows.

The trade-off is flexibility versus abstraction. Keyword-driven tests are easy to read and maintain for standard workflows but become awkward for complex logic, conditional branching, or dynamic data. They also require investment in framework engineering up front and rely on disciplined keyword naming so the library does not balloon into hundreds of near-duplicates. Most mature automation teams use keyword-driven testing for high-level smoke and regression tests while reserving script-based testing with Playwright or Selenium for complex flows that demand programmatic control.

On the tooling side, Robot Framework is the reference implementation of the pattern. Low-level keywords come from libraries such as SeleniumLibrary or the Playwright-based Browser library, and teams compose higher-level user keywords (Login As Admin, Place Standard Order) from them in plain-text .robot resource files with tabular syntax, which keeps the keyword library versioned in git alongside the code. Katalon Studio packages the same idea commercially: testers assemble built-in keywords in a table UI while engineers extend the library with custom Groovy keywords, and TestComplete offers a comparable keyword-table editor. In every implementation the layering is identical: locators in an object repository, actions wrapped as keywords, and test cases expressed as keyword sequences.

Be honest about when not to use it in 2026. The original selling point, letting non-programmers author tests, has weakened now that Playwright codegen, AI-assisted test generation, and readable APIs like Playwright's getByRole make code-based tests far more approachable than raw Selenium was a decade ago. If the team already writes TypeScript or Python, a keyword layer mostly adds indirection: one more abstraction to debug through, a custom DSL that new hires must learn, and a translation tax every time a scenario needs logic the keywords do not expose. Reserve keyword-driven frameworks for contexts where a genuinely non-coding group must own test authoring long term, such as business analysts maintaining regulated end-to-end scenarios; otherwise a well-factored Page Object or fixture layer delivers the same reuse without the abstraction overhead.

WHY IT MATTERS

Why interviewers ask about this.

Interviewers ask about keyword-driven testing to evaluate your understanding of framework architectures and your ability to make testing accessible to non-technical team members. Senior candidates are expected to discuss when keyword-driven testing pays off versus when it adds overhead.

EXAMPLE

Example scenario.

A QA analyst creates a keyword-driven test for order placement: Open_Browser, Login "admin" "password", Search_Product "Widget A", Add_To_Cart, Checkout, Verify_Order_Confirmation. The analyst writes no code. The SDET maintains the keyword implementations and adds new keywords as features are built.

TIP

Interview tip.

Compare keyword-driven testing with data-driven testing and explain when you would choose each. Mentioning Robot Framework as a concrete tool implementation strengthens your answer, and acknowledging the up-front engineering cost shows seniority.

FAQ

Frequently asked questions.

What is a keyword-driven framework with an example?

A keyword-driven framework is an automation framework where test cases are written as sequences of action words instead of raw code. For example, a login test might read: Open_Browser, Navigate "/login", Enter_Text "email" "user@test.com", Enter_Text "password" "secret", Click "submit", Verify_Text "Welcome". Each keyword maps to a reusable function that handles the actual browser interaction. Robot Framework is the most common implementation.

What is the difference between keyword-driven and data-driven testing?

Keyword-driven testing abstracts the actions of a test (Click, Enter_Text, Verify) so non-coders can compose test cases from a library of action words. Data-driven testing keeps the test logic in code and only varies the inputs across many rows of a data table, useful for running the same scenario with different combinations of data. Hybrid frameworks combine both: keyword scenarios parameterised across data rows.

When should you use keyword-driven testing?

Keyword-driven testing is most valuable when domain experts or manual testers need to author and maintain tests without learning a programming language, when test scenarios share a small set of repeating actions across many flows, and when stakeholders want test cases to read as living documentation. Avoid it when tests need complex branching, dynamic data manipulation, or when the team has the engineering capacity to maintain a code-based framework instead.

What are the advantages and disadvantages of keyword-driven testing?

Advantages: tests are readable by non-technical stakeholders, the keyword library forces reuse, and changes to UI flow only require updating the keyword definition once. Disadvantages: significant up-front investment to build the framework, awkward for complex logic or conditional flows, and risk of keyword sprawl where dozens of near-duplicate keywords accumulate without governance. Teams should weigh whether the readability win outweighs the engineering cost.

Which tools support keyword-driven testing?

Robot Framework is the dominant open-source implementation, with a rich ecosystem of libraries (SeleniumLibrary, RequestsLibrary, AppiumLibrary). TestComplete and Katalon Studio also offer keyword-driven test design. Selenium and Playwright are not keyword-driven by default but can be wrapped in a custom keyword layer if a team wants the abstraction without leaving their existing toolchain.

Related Resources

Dive deeper with these related interview prep pages.

FREE TOOLS  /  no signup

Free QA career tools, no account needed

Instant and private, everything runs in your browser. Try them before you sign up.

EXEC.NOW

Ready to Ace Your QA Interview?

Practice explaining keyword-driven testing and other key concepts with our AI interviewer.

Join 1,200+ QA engineers already practicing with AssertHired.

Start your free QA interview

Curious how it works first? See the QA mock interview

FREE.TO.START  ·  7.DAY.TRIAL ON PAID PLANS
Written by Aston Cook, Senior QA EngineerLast updated July 2026