You open a test file that fails every Tuesday. The login steps are copied into 40 other files, the password is hardcoded, and nobody knows which spreadsheet feeds it. The tool is fine. What's missing is the structure around it.
That structure is the test automation framework.
Updated December 2026
A test automation framework is the set of rules, reusable components and tools that decides how automated tests are written, organized, run and reported. It sits on top of a tool such as Selenium or Playwright. The six common types are linear, modular, data-driven, keyword-driven, behavior-driven (BDD) and hybrid.
Looking for a ranked list of tools instead? Read Best Test Automation Frameworks in 2026: 10 Compared (With Code).
Key takeaways
- A framework is not a tool. Playwright is a tool; how you structure tests, data and reports around it is the framework.
- Every automation framework has the same core parts: a runner, assertions, a driver, a reusable layer, test data, configuration, reporting and CI.
- Most production suites are hybrids, usually modular plus data-driven with page objects.
- Pick the type by who writes tests and how fast the app changes, not by what is trending.
By Robonito Engineering Team · Updated December 2026 · 22 min read
Quick Stats
| Fact | Source |
|---|---|
| Teams with mature test automation release 24× more frequently | DORA State of DevOps 2025 |
| Poorly chosen frameworks increase test maintenance cost by 40–60% | Capgemini World Quality Report |
| 62% of automation projects fail due to framework choice, not tool choice | Gartner |
| Automated tests catch bugs 85× faster than manual regression testing | IBM Systems Research |
Table of Contents
- What is a test automation framework?
- What are the components of a test automation framework?
- Why does framework choice matter more than tool choice?
- What are the types of test automation frameworks?
- Which framework type should you choose?
- Real code examples for each framework
- Which tools fit each framework type?
- How does a framework plug into CI/CD?
- What does a framework cost to set up and maintain?
- When should you not build a full automation framework?
- Pre-implementation checklist
- Common mistakes and how to avoid them
- Where does Robonito fit?
- Frequently asked questions
1. What is a test automation framework?
A test automation framework is a structured system of guidelines, reusable components, tools and conventions that defines how automated tests are written, organized, executed and maintained. It is the architecture that sits beneath your individual test cases.
Here is the distinction most articles miss: a framework is not a tool. Selenium is a tool. Playwright is a tool. pytest is a tool. The framework is the pattern and structure you put around those tools: how you organize test files, how you manage test data, how you handle authentication, how you report results, and how tests connect to your CI/CD pipeline.
Two teams can both use Playwright and have completely different frameworks. One team has a well-structured Page Object Model with shared fixtures, central configuration and parallel execution. The other has 300 test files with duplicated selectors, hardcoded credentials, and tests that only run on one engineer's laptop. Same tool. Completely different outcomes.
The framework is the difference.
Test automation framework vs testing tool
| Testing tool | Test automation framework | |
|---|---|---|
| What it is | A library or app that does one job | The structure and rules around one or more tools |
| Examples | Selenium WebDriver, Playwright, Appium, pytest | A modular Playwright suite with page objects, JSON test data and an HTML report in GitHub Actions |
| Who decides it | The vendor or open-source project | Your team |
| What it controls | How a browser or device is driven | How tests are organized, reused, fed with data, run and reported |
| Changes when | You switch tools | You change how the team works |
One-line definition: A test automation framework is a set of rules, components and conventions that standardize how automated tests are built, organized and run across a project or organization.
2. What are the components of a test automation framework?
Whatever the type, every automated testing framework is built from the same layers. Read the table top to bottom: it follows one test run from the moment CI starts it to the report your team reads.
| Layer (in run order) | What it does | Typical choices | The question it answers |
|---|---|---|---|
| 1. CI trigger | Starts the suite on a push, pull request or schedule | GitHub Actions, GitLab CI, Jenkins, Azure DevOps | When do tests run, and which ones? |
| 2. Configuration | Holds base URLs, browsers, timeouts and secrets per environment | playwright.config.ts, pytest.ini, .env files, CI secrets | Where am I testing, and with what settings? |
| 3. Test runner | Finds tests, runs them (often in parallel), handles setup and teardown | pytest, JUnit 5, TestNG, Playwright Test, Cypress, Robot Framework | In what order and how many at once? |
| 4. Test cases | The scenarios themselves: steps plus expected results | .spec.ts, test_*.py, .feature, .robot files | What behavior are we checking? |
| 5. Reusable layer | Shared actions so steps live in one place | Page objects, modules, keyword libraries, step definitions, fixtures | Where do I fix a step once for every test? |
| 6. Driver / automation library | Actually drives the browser, device or API | Selenium WebDriver, Playwright, Appium, httpx, REST Assured | How do we click, type and call the app? |
| 7. Test data | Inputs and expected outputs kept apart from code | CSV, JSON, Excel, factories, seeded databases | What values do we test with, and how are they reset? |
| 8. Assertions | Compare actual results with expected ones and fail clearly | expect(), assert, AssertJ, Hamcrest, Chai | Did the app do the right thing? |
| 9. Reporting and logs | Turn results into something people can act on | JUnit XML, Allure, pytest-html, Playwright HTML report, screenshots, videos, traces | What failed, where and why? |
A quick way to audit an existing suite: for each row, name the file or tool that fills it. Any row you cannot name is where the next flaky failure will come from. Test data (row 7) and reporting (row 9) are the two rows teams most often leave blank.
3. Why does framework choice matter more than tool choice?
Most teams spend most of their evaluation time comparing tools (Cypress vs Playwright, TestNG vs JUnit) and very little time on framework patterns. That is backwards.
The tool executes your tests. The framework decides whether your test suite is still maintainable in 12 months. Here is what happens when the framework does not fit:
Wrong framework → wrong outcome:
| Framework mismatch | What actually happens |
|---|---|
| Linear framework on a large project | Tests break on every UI change; maintenance takes longer than manual testing |
| Data-driven framework without clean data management | Test data becomes a spreadsheet nightmare; tests fail for data reasons, not code reasons |
| BDD framework when no non-technical stakeholders write or read tests | Feature files become an extra maintenance burden with no communication benefit |
| Modular framework with no agreed structure | Modules fragment; different engineers rewrite the same helpers independently |
The tool rarely fails. The structure around it does.
4. What are the types of test automation frameworks?
There are six core framework types. Most real-world implementations are hybrids of two or more. (Some guides also list a seventh, the library architecture framework, which is the modular idea with shared functions grouped into a library.)
The 6 types at a glance
| Type | How tests are organized | Who usually writes tests | Maintenance as the suite grows | Best for |
|---|---|---|---|---|
| Linear | One script per test, steps in sequence, often recorded | Anyone | Very high | Proofs of concept, a handful of tests |
| Modular | Tests call shared modules or page objects | Engineers | Low | Most code-based suites over 20 tests |
| Data-driven | One script, many rows of external data | Engineers; data can come from QA | Low, if data is managed | Forms, validation, pricing rules, APIs |
| Keyword-driven | Tables of action words mapped to code | QA analysts and BAs, with engineers maintaining keywords | Medium | Mixed-skill teams, readable test docs |
| BDD | Given/When/Then feature files bound to step code | Product, QA and engineers together | Medium | Teams that really review specs together |
| Hybrid | Two or more of the above combined | Engineers plus others | Low to medium | Production suites over 50 tests |
4.1 Linear framework (record and playback)
What it is: The simplest possible structure. Tests are written sequentially, step by step, with no abstraction, no shared components and no data separation. Often generated by recording browser actions.
How it actually works:
## Linear framework: everything hardcoded, everything sequential
from selenium import webdriver
from selenium.webdriver.common.by import By
import time
driver = webdriver.Chrome()
driver.get("https://yourapp.com/login")
driver.find_element(By.ID, "email").send_keys("testuser@example.com")
driver.find_element(By.ID, "password").send_keys("Password123")
driver.find_element(By.ID, "submit").click()
time.sleep(2)
assert "Dashboard" in driver.title
driver.quit()
When it is genuinely appropriate:
- Proof-of-concept automation (first 2 weeks of exploring a new tool)
- One-off scripts for a single regression test that will never be repeated
- Small projects with 5–10 tests that will not grow
When it breaks down: The moment you have more than 20 tests. Every test duplicates the login sequence, the browser setup and the teardown. When the login page changes, you update 20 tests instead of 1.
Honest verdict: Do not build a production test suite on a linear framework. Use it to learn, then move to modular. If you are comparing recorders, see the best record and playback testing tools.
4.2 Modular framework
What it is: Tests are broken into independent, reusable modules. Each module represents a distinct part of the application (login module, search module, checkout module). Tests compose these modules rather than duplicating steps.
Structure:
tests/
modules/
auth.py ## Login, logout, registration helpers
cart.py ## Add to cart, remove, update quantity
checkout.py ## Payment, shipping, order confirmation
test_purchase_flow.py
test_account_management.py
How it actually works:
## modules/auth.py
from selenium.webdriver.common.by import By
class AuthModule:
def __init__(self, driver):
self.driver = driver
def login(self, email, password):
self.driver.get("https://yourapp.com/login")
self.driver.find_element(By.ID, "email").send_keys(email)
self.driver.find_element(By.ID, "password").send_keys(password)
self.driver.find_element(By.ID, "submit").click()
def logout(self):
self.driver.find_element(By.ID, "user-menu").click()
self.driver.find_element(By.LINK_TEXT, "Sign out").click()
## test_purchase_flow.py
from modules.auth import AuthModule
from modules.cart import CartModule
from modules.checkout import CheckoutModule
def test_complete_purchase(driver):
auth = AuthModule(driver)
cart = CartModule(driver)
checkout = CheckoutModule(driver)
auth.login("testuser@example.com", "Password123")
cart.add_item("product-abc-123")
checkout.complete_purchase(card="4242424242424242")
assert checkout.get_confirmation_number() is not None
When to use it: Any project with more than 20 tests and a team of 2+ engineers. This is the baseline professional standard.
Maintenance benefit: When the login page changes, you update AuthModule.login() in one place. Every test that uses it is fixed at once.
4.3 Data-driven framework
What it is: Test logic and test data are completely separated. The same test script runs multiple times with different inputs from external files (CSV, Excel, JSON, database). The test code never contains hardcoded test data.
How it actually works:
## test_login_data_driven.py
import csv
import pytest
from selenium.webdriver.common.by import By
def load_login_test_data():
with open("test_data/login_cases.csv") as f:
reader = csv.DictReader(f)
return [(row["email"], row["password"], row["expected_result"]) for row in reader]
@pytest.mark.parametrize("email,password,expected", load_login_test_data())
def test_login(driver, email, password, expected):
driver.get("https://yourapp.com/login")
driver.find_element(By.ID, "email").send_keys(email)
driver.find_element(By.ID, "password").send_keys(password)
driver.find_element(By.ID, "submit").click()
if expected == "success":
assert "Dashboard" in driver.title
elif expected == "invalid_credentials":
assert driver.find_element(By.CLASS_NAME, "error-message").is_displayed()
elif expected == "locked_account":
assert "account locked" in driver.page_source.lower()
## test_data/login_cases.csv
email,password,expected_result
valid@example.com,ValidPass123,success
invalid@example.com,wrongpass,invalid_credentials
locked@example.com,AnyPass123,locked_account
,ValidPass123,invalid_credentials
valid@example.com,,invalid_credentials
valid@example.com,short,invalid_credentials
When to use it: Applications with extensive input validation (forms, APIs, calculators), e-commerce platforms with many product and pricing variations, or any test suite where the scenarios are stable but the data changes often.
Critical gotcha: Data-driven frameworks need disciplined data management. If your CSV files drift out of date, your entire test suite gives false confidence. Treat test data with the same care as production data.
4.4 Keyword-driven framework
What it is: Tests are written as tables of keywords (human-readable action words) that map to underlying code. A non-technical stakeholder can read and even write test cases without touching code.
How it actually works:
| Keyword | Target | Value |
|---|---|---|
OpenBrowser | Chrome | — |
NavigateTo | https://yourapp.com/login | — |
EnterText | #email | testuser@example.com |
EnterText | #password | Password123 |
ClickElement | #submit | — |
VerifyTitle | Dashboard | — |
CloseBrowser | — | — |
Each keyword maps to a function in your keyword library:
## keyword_library.py
from selenium import webdriver
from selenium.webdriver.common.by import By
class KeywordLibrary:
def __init__(self):
self.driver = None
def open_browser(self, browser="chrome"):
self.driver = webdriver.Chrome() if browser.lower() == "chrome" else webdriver.Firefox()
def navigate_to(self, url):
self.driver.get(url)
def enter_text(self, selector, text):
self.driver.find_element(By.CSS_SELECTOR, selector).send_keys(text)
def click_element(self, selector):
self.driver.find_element(By.CSS_SELECTOR, selector).click()
def verify_title(self, expected_title):
assert expected_title in self.driver.title, \
f"Expected '{expected_title}' in title, got '{self.driver.title}'"
def close_browser(self):
self.driver.quit()
Best tool for this approach: Robot Framework is the best-known tool for keyword-driven testing. It provides the table-based test syntax out of the box.
When to use it: When business analysts or QA engineers without programming backgrounds need to write or maintain test cases. When test cases double as living documentation that non-technical stakeholders review.
When to avoid it: When your team is all engineers. The abstraction layer adds overhead without the collaboration benefit.
4.5 Behavior-driven development (BDD) framework
What it is: Tests are written in plain English using a structured Given/When/Then syntax (Gherkin). These "feature files" serve as both test specifications and living documentation. Business stakeholders, product managers and engineers all work from the same source of truth.
How it actually works:
## features/checkout.feature
Feature: Checkout process
As a registered customer
I want to complete a purchase
So that I can receive my order
Background:
Given I am logged in as a registered customer
Scenario: Successful checkout with valid payment
Given I have 1 item in my cart
When I proceed to checkout
And I enter valid shipping details
And I enter a valid credit card "4242424242424242"
And I click "Place order"
Then I should see the order confirmation page
And I should receive a confirmation email
Scenario Outline: Checkout fails with invalid card
Given I have 1 item in my cart
When I proceed to checkout
And I enter valid shipping details
And I enter card number "<card_number>"
Then I should see the error "<expected_error>"
Examples:
| card_number | expected_error |
| 4000000000000002 | Your card was declined |
| 4000000000009995 | Your card has insufficient funds |
| 1234567890123456 | Please enter a valid card number |
## steps/checkout_steps.py
from pytest_bdd import given, when, then, parsers
from pages.cart_page import CartPage
from pages.checkout_page import CheckoutPage
@given("I have 1 item in my cart")
def add_item_to_cart(driver):
cart = CartPage(driver)
cart.add_item("test-product-001")
@when("I proceed to checkout")
def proceed_to_checkout(driver):
checkout = CheckoutPage(driver)
checkout.go_to_checkout()
@when(parsers.parse('I enter card number "{card_number}"'))
def enter_card_number(driver, card_number):
checkout = CheckoutPage(driver)
checkout.enter_card(card_number)
@then("I should see the order confirmation page")
def verify_confirmation(driver):
checkout = CheckoutPage(driver)
assert checkout.is_confirmation_visible()
@then(parsers.parse('I should see the error "{expected_error}"'))
def verify_error_message(driver, expected_error):
checkout = CheckoutPage(driver)
assert checkout.get_error_message() == expected_error
When to use it: When product managers and business analysts actively help define acceptance criteria. When test cases need to double as readable specifications. When you work in an Agile/Scrum setup with regular sprint reviews.
When to avoid it: When non-technical stakeholders do not actually read the feature files. If no one outside engineering ever opens the .feature files, you carry the overhead of BDD without the benefit. This is the most common BDD anti-pattern.
Best tools: Cucumber (Java/JS/Ruby), pytest-bdd (Python), Behave (Python) and, for .NET, Reqnroll, which describes itself as a reboot of the SpecFlow project and is where most SpecFlow users are moving.
4.6 Hybrid framework
What it is: A deliberate combination of two or more framework types, designed to take the best features of each. Most mature test suites are hybrids, typically modular + data-driven + Page Object Model, or BDD + data-driven.
A real hybrid example: modular + data-driven + Page Object Model:
tests/
pages/ ## Page Object Model layer
login_page.py
dashboard_page.py
checkout_page.py
modules/ ## Modular reusable flows
auth_flows.py
purchase_flows.py
test_data/ ## Data-driven layer
login_cases.json
checkout_cases.csv
fixtures/ ## Shared test setup
browser_setup.py
test_users.py
tests/ ## Actual test cases
test_login.py
test_checkout.py
conftest.py ## pytest configuration
pytest.ini
## pages/checkout_page.py: Page Object Model
from selenium.webdriver.common.by import By
class CheckoutPage:
def __init__(self, driver):
self.driver = driver
@property
def place_order_button(self):
return self.driver.find_element(By.CSS_SELECTOR, "[data-testid='place-order-btn']")
def enter_shipping_address(self, address: dict):
self.driver.find_element(By.ID, "address-line1").send_keys(address["line1"])
self.driver.find_element(By.ID, "city").send_keys(address["city"])
self.driver.find_element(By.ID, "postal-code").send_keys(address["postal_code"])
def submit_order(self):
self.place_order_button.click()
def get_order_number(self) -> str:
return self.driver.find_element(By.CSS_SELECTOR, "[data-testid='order-number']").text
def get_error_message(self) -> str:
return self.driver.find_element(By.CSS_SELECTOR, "[role='alert']").text
## tests/test_checkout.py: combining all layers
import json
import pytest
from pages.checkout_page import CheckoutPage
from modules.purchase_flows import add_item_and_proceed
with open("test_data/checkout_cases.json") as f:
checkout_cases = json.load(f)
@pytest.mark.parametrize("case", checkout_cases)
def test_checkout_flow(driver, authenticated_user, case):
add_item_and_proceed(driver, product_id=case["product_id"])
checkout = CheckoutPage(driver)
checkout.enter_shipping_address(case["shipping"])
checkout.submit_order()
if case["expected"] == "success":
assert checkout.get_order_number() is not None
else:
assert checkout.get_error_message() == case["expected_error"]
When to use it: For any production test suite with more than 50 test cases. This is how most engineering teams that take quality seriously end up structuring their suites.
5. Which framework type should you choose?
Use this matrix to short-list the right automation framework for your situation. Find your main constraint in the left column, then follow the recommendation.
| Your situation | Recommended framework | Why |
|---|---|---|
| Solo developer, small project | Linear → Modular | Start simple, add structure when tests grow |
| Team of engineers, web app | Modular + Page Object Model | Best maintainability-to-complexity ratio |
| Business analysts write test cases | BDD (Cucumber) or keyword-driven (Robot Framework) | Lets non-technical people take part |
| Heavy form or input validation testing | Data-driven | One script tests hundreds of input combinations |
| Large enterprise, mixed technical levels | Hybrid (Modular + Data-driven + BDD) | Covers all stakeholder types |
| API-first product | Modular + Data-driven | API tests are naturally data-driven |
| Mobile app | Keyword-driven (Robot Framework + Appium) | Robot Framework has an Appium library (AppiumLibrary) for mobile keywords |
| Existing Java or .NET codebase | TestNG or JUnit (Java), Reqnroll (.NET) | Matching the language ecosystem reduces friction |
| Need fast CI feedback | Modular + Playwright | Playwright Test runs test files in parallel by default |
| No one on the team writes code | A plain-language platform such as Robonito | Tests are described in plain English; the platform supplies runner, healing and reports |
The single most important question to ask before choosing:
"Six months from now, when a new engineer joins the team and a test breaks, how long will it take them to find, understand and fix the problem?"
The framework that keeps that answer shortest is the right framework for your team. For the wider planning around it, see our test automation strategy document template.
6. Real code examples for each framework
Page Object Model: the most important pattern to master
The Page Object Model (POM) is not a standalone framework type. It is a design pattern used inside modular and hybrid frameworks, and it is important enough to deserve its own example. Almost every professional web UI test suite uses it.
// pages/LoginPage.ts: Playwright + TypeScript POM
import { Page, Locator, expect } from '@playwright/test';
export class LoginPage {
readonly page: Page;
readonly emailInput: Locator;
readonly passwordInput: Locator;
readonly submitButton: Locator;
readonly errorMessage: Locator;
constructor(page: Page) {
this.page = page;
this.emailInput = page.getByLabel('Email address');
this.passwordInput = page.getByLabel('Password');
this.submitButton = page.getByRole('button', { name: 'Sign in' });
this.errorMessage = page.getByRole('alert');
}
async goto() {
await this.page.goto('/login');
}
async login(email: string, password: string) {
await this.emailInput.fill(email);
await this.passwordInput.fill(password);
await this.submitButton.click();
}
async expectErrorMessage(message: string) {
await expect(this.errorMessage).toContainText(message);
}
}
// tests/login.spec.ts: clean test using the POM
import { test, expect } from '@playwright/test';
import { LoginPage } from '../pages/LoginPage';
import { DashboardPage } from '../pages/DashboardPage';
test.describe('Login', () => {
test('valid credentials navigate to dashboard', async ({ page }) => {
const loginPage = new LoginPage(page);
const dashboardPage = new DashboardPage(page);
await loginPage.goto();
await loginPage.login('valid@example.com', 'ValidPass123');
await dashboardPage.expectToBeVisible();
});
test('invalid credentials show error', async ({ page }) => {
const loginPage = new LoginPage(page);
await loginPage.goto();
await loginPage.login('invalid@example.com', 'wrongpassword');
await loginPage.expectErrorMessage('Invalid email or password');
});
test('empty password shows validation error', async ({ page }) => {
const loginPage = new LoginPage(page);
await loginPage.goto();
await loginPage.login('valid@example.com', '');
await loginPage.expectErrorMessage('Password is required');
});
});
TestNG (Java): data-driven with @DataProvider
// LoginTest.java: TestNG data-driven framework
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import static org.testng.Assert.*;
public class LoginTest extends BaseTest {
@DataProvider(name = "loginData")
public Object[][] loginData() {
return new Object[][] {
{ "valid@example.com", "ValidPass123", true, null },
{ "invalid@example.com", "wrongpass", false, "Invalid email or password" },
{ "", "ValidPass123", false, "Email is required" },
{ "valid@example.com", "", false, "Password is required" },
{ "locked@example.com", "ValidPass123", false, "Your account has been locked" },
};
}
@Test(dataProvider = "loginData")
public void testLogin(String email, String password,
boolean expectSuccess, String expectedError) {
LoginPage loginPage = new LoginPage(driver);
loginPage.navigateTo();
loginPage.enterEmail(email);
loginPage.enterPassword(password);
loginPage.clickSubmit();
if (expectSuccess) {
DashboardPage dashboard = new DashboardPage(driver);
assertTrue(dashboard.isLoaded(), "Expected dashboard to load after login");
} else {
assertEquals(loginPage.getErrorMessage(), expectedError);
}
}
}
pytest: API + modular framework
## conftest.py: shared fixtures
import pytest
import httpx
import os
@pytest.fixture(scope="session")
def api_client():
"""Authenticated API client shared across all tests in the session."""
base_url = os.getenv("API_BASE_URL", "http://localhost:8000")
token = os.getenv("TEST_API_TOKEN")
headers = {"Authorization": f"Bearer {token}", "Content-Type": "application/json"}
with httpx.Client(base_url=base_url, headers=headers, timeout=10.0) as client:
yield client
@pytest.fixture
def test_user(api_client):
"""Creates a fresh test user and cleans up after the test."""
res = api_client.post("/api/v1/users", json={
"email": f"test+{os.urandom(4).hex()}@example.com",
"password": "TestPassword123"
})
user = res.json()
yield user
# Teardown: delete the test user after each test
api_client.delete(f"/api/v1/users/{user['id']}")
## tests/test_user_api.py
import pytest
class TestUserAPI:
def test_create_user_returns_201(self, api_client):
res = api_client.post("/api/v1/users", json={
"email": "newuser@example.com",
"password": "SecurePass123"
})
assert res.status_code == 201
assert "id" in res.json()
assert res.json()["email"] == "newuser@example.com"
def test_cannot_create_duplicate_email(self, api_client, test_user):
res = api_client.post("/api/v1/users", json={
"email": test_user["email"],
"password": "AnotherPass123"
})
assert res.status_code == 409
assert res.json()["error"] == "Email already registered"
def test_get_user_profile(self, api_client, test_user):
res = api_client.get(f"/api/v1/users/{test_user['id']}")
assert res.status_code == 200
assert res.json()["id"] == test_user["id"]
assert "password" not in res.json()
assert "password_hash" not in res.json()
7. Which tools fit each framework type?
This guide is about framework types. If you want the tools themselves ranked and compared, with languages, licenses, popularity and code, read Best Test Automation Frameworks in 2026: 10 Compared.
The short mapping:
- Linear: any recorder (Selenium IDE, Playwright codegen).
- Modular: Playwright, Selenium, Cypress or WebdriverIO, plus page objects.
- Data-driven: pytest
parametrize, TestNG@DataProvider, JUnit 5 parameterized tests. - Keyword-driven: Robot Framework.
- BDD: Cucumber, pytest-bdd, Behave, Reqnroll.
- Hybrid: any of the above runners combined with page objects and external data.
8. How does a framework plug into CI/CD?
CI is the layer that turns a test suite into a safety net. These three workflows cover the most common runners. Each one also publishes a report, which is the layer teams forget.
pytest in GitHub Actions
## .github/workflows/test.yml
name: Python Test Suite
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with: { python-version: '3.12' }
- run: pip install -r requirements-test.txt
- run: pytest tests/ -v --tb=short --junitxml=test-results.xml
- uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: test-results.xml
Playwright in GitHub Actions
## .github/workflows/playwright.yml
name: Playwright E2E Tests
on: [push, pull_request]
jobs:
playwright:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: '20', cache: 'npm' }
- run: npm ci
- run: npx playwright install --with-deps
- run: npx playwright test --reporter=html
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
Cucumber (Java/Maven) in GitHub Actions
## .github/workflows/cucumber.yml
name: Cucumber BDD Tests
on: [push, pull_request]
jobs:
cucumber:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with: { java-version: '21', distribution: 'temurin' }
- run: mvn test -Dcucumber.filter.tags="@smoke or @regression"
- uses: actions/upload-artifact@v4
if: always()
with:
name: cucumber-reports
path: target/cucumber-reports/
CI pipeline timing targets
| Framework | Typical test count | Target CI time |
|---|---|---|
| Unit (pytest/JUnit) | 200–500 | < 2 min |
| Modular integration (Playwright) | 50–100 | < 8 min |
| BDD E2E (Cucumber) | 30–60 scenarios | < 15 min |
| Data-driven (100 data sets) | 100 iterations | < 5 min |
| Full hybrid suite | 200–400 tests | < 20 min |
Which tests run at which stage is a strategy question. Our guide to automated regression testing covers how to split a suite into smoke, PR and nightly runs.
9. What does a framework cost to set up and maintain?
One of the most practical questions teams ask is: how much does this cost? These are rough planning ranges, not benchmarks. Your numbers will depend on the app, the team and how much already exists.

Setup time by framework
| Framework | Initial setup time | First meaningful tests running |
|---|---|---|
| Linear | 1–2 hours | Same day |
| Modular | 1–2 days | 2–3 days |
| Data-driven | 2–3 days | 3–5 days |
| BDD | 3–5 days | 1 week |
| Hybrid | 1–2 weeks | 1–2 weeks |
Maintenance cost over 12 months (relative)
| Framework | Maintenance cost | Primary driver |
|---|---|---|
| Linear | Very high (4×) | Every test breaks on any UI change |
| Modular | Low (1×) | Changes isolated to modules |
| Data-driven | Low (1×) | Logic stable; data changes separately |
| BDD | Medium (1.5×) | Feature file + step definition sync |
| Hybrid | Low-Medium (1.2×) | Upfront investment pays off |
ROI calculation example
A team of 5 engineers doing 2 hours of manual regression per sprint (biweekly):
- Manual cost: 5 × 2 × 26 = 260 hours/year at $80/hr = $20,800/year
- Framework setup (Modular/Playwright): 40 hours = $3,200 one-time
- Framework maintenance: 1 hour/sprint = 26 hours/year = $2,080/year
- Net saving year 1: $20,800 − $3,200 − $2,080 = $15,520
- Net saving year 2+: $20,800 − $2,080 = $18,720/year
This is a conservative example. It does not include the cost of production bugs caught earlier. Swap in your own hours and rate.
10. When should you not build a full automation framework?
This is the section most automation guides leave out, and it is often the most useful.
Do not invest in a full framework when:
The project will be live for less than 3 months. Setup and maintenance cost more than you save. Write a handful of smoke tests and move on.
The team has no one to maintain it. An automation framework without an owner degrades quickly. Tests start failing, no one fixes them, and within 6 months the suite is ignored. An ignored test suite is worse than no tests, because it creates false confidence.
The application changes every week. If the UI is redesigned every sprint, even a well-structured Page Object Model struggles to keep up. Put more weight on API tests, which do not depend on the layout and so break far less often.
The "automation" is actually a one-time migration script. Automation frameworks are for repeatable testing. If you need to run something once to migrate data, a framework is overkill.
You do not have a clear definition of done. If "done" is not defined (what coverage? what must pass in CI?), you will keep building without delivering value.
11. Pre-implementation checklist
Complete this before writing a single test. Copy it into your team's wiki or ticket.
Strategy
- Defined what application layer(s) to test first (UI, API or both)
- Identified which framework type fits the team and project (see section 5)
- Agreed on the programming language (match team expertise, not trends)
- Defined what "done" looks like (coverage targets, CI pass rates)
- Identified who owns test maintenance long term
Technical foundation
- Version control repository set up for test code (treat tests like production code)
- Test environments defined (local, staging, CI)
- Test data strategy documented (how is data created, reset and cleaned up?)
- CI/CD pipeline integration planned (which stage runs which tests?)
- Reporting tool chosen (Allure, pytest-html, Playwright HTML report)
Team alignment
- Engineers, QA and product aligned on the framework approach
- Coding standards documented for the test suite
- PR review process includes test quality review
- Onboarding documentation drafted so a new engineer can run tests on day 1
12. Common mistakes and how to avoid them
Mistake 1: Treating automation as a replacement for manual testing
Automation is a regression safety net, not a substitute for exploratory testing. Automated tests verify that known good behavior stays good. Manual testing finds new problems that no one thought to write a test for. You need both.
Mistake 2: Automating everything from day one
The most common failure in automation projects is trying to automate everything at once. Start with the small set of tests that give the most value: your smoke suite and critical paths. Grow from a stable base rather than building everything and maintaining nothing well.
Mistake 3: Ignoring test independence
Tests that depend on each other, where test B only passes if test A ran first, are a maintenance disaster. Every test must be able to run in any order, in any environment, in isolation. Use fixtures and setup/teardown properly. Never share mutable state between tests.
Mistake 4: Hardcoding credentials, URLs and environment config
## ❌ Every engineer and every environment needs a code change
BASE_URL = "http://localhost:3000"
TEST_EMAIL = "admin@company.com"
TEST_PASSWORD = "CompanyPass2026!"
## ✅ Driven by environment variables, works everywhere
import os
BASE_URL = os.getenv("TEST_BASE_URL", "http://localhost:3000")
TEST_EMAIL = os.getenv("TEST_USER_EMAIL")
TEST_PASSWORD = os.getenv("TEST_USER_PASSWORD")
Mistake 5: Writing assertions that test the framework, not the application
// ❌ Only proves Playwright can click a button
await page.click('#submit-btn');
expect(true).toBe(true);
// ✅ Actually verifies the application behavior
await page.getByRole('button', { name: 'Place order' }).click();
await expect(page.getByTestId('order-confirmation')).toBeVisible();
await expect(page.getByTestId('order-number')).toHaveText(/^ORD-\d{8}$/);
Mistake 6: No clear naming convention
Test names like test_1, test_login_v2_final or test_DONT_DELETE are technical debt from day one. Every test name should answer: what user action is being tested, under what condition, and what is the expected outcome.
## ❌ Tells you nothing when it fails
def test_checkout_2():
## ✅ Tells you exactly what failed and why it matters
def test_checkout_fails_with_expired_card_and_shows_error_message():
13. Where does Robonito fit?
Robonito is an agentic QA platform, not a code library, so it takes a different route to the same layers in section 2. Instead of building a runner, reusable layer and reporting yourself, you describe what to test in plain English (or record a flow in the desktop app, or build no-code tests from reusable steps), and AI agents create, run and maintain the end-to-end tests.
How it maps to the framework components:
| Framework layer | In a code framework | In Robonito |
|---|---|---|
| Test cases | You write code or feature files | Plain-language descriptions, recordings or no-code steps; AI Studio can also start from Jira stories, requirement documents or Swagger/OpenAPI definitions |
| Reusable layer | Page objects and modules you maintain | Reusable steps; self-healing adapts steps when labels, layouts or locators change, and logs each healed step for review |
| Runner | pytest, Playwright Test, TestNG | Parallel runs in isolated cloud workers, or free local runs |
| Reporting | Allure, HTML reports, traces you wire up | Video, network traces and an AI root cause for every failed run, plus pass rates and trends |
| CI | Your YAML | Jenkins, GitHub Actions, GitLab CI, Azure DevOps and CircleCI (Starter plan and above) |
Where it fits: teams without dedicated automation engineers, or teams whose suites spend more time being repaired than run. Web testing is on every plan, including Free; mobile (Android and iOS), desktop and API testing are on Pro and Enterprise. See the automation testing tool overview and pricing.
Where it doesn't: if your team wants every test to live as code in the same repository, reviewed in pull requests and extended with custom libraries, a code framework such as Playwright or pytest is the more natural fit. Robonito can generate executable code for test cases, and low-code extensions cover advanced cases, but its center of gravity is plain-language tests, not hand-written code.
·
Frequently asked questions
What is a test automation framework?
A test automation framework is a structured set of guidelines, reusable components, tools and conventions that defines how automated tests are written, organized, executed and maintained. It is the architecture beneath your individual test cases, not the tool itself.
What are the components of a test automation framework?
The core components are a test runner, test cases, a reusable layer (page objects, modules or keywords), a driver or automation library, test data, assertions, configuration, reporting and CI integration. Section 2 shows them in the order a test run passes through them.
What are the 6 types of test automation frameworks?
Linear (record and playback), modular, data-driven, keyword-driven, behavior-driven (BDD) and hybrid. Some guides add a library architecture framework, which is a modular framework with shared functions grouped into a library.
Is Selenium a test automation framework?
Not on its own. Selenium WebDriver is a browser automation tool. It becomes part of a framework when you add a runner (JUnit, TestNG or pytest), page objects, test data, reporting and CI around it. The same is true of Playwright, though Playwright Test ships with its own runner and reporter.
Which test automation framework should I start with?
If your team writes code: start with modular + Page Object Model using Playwright (JavaScript/TypeScript) or pytest (Python). If non-technical stakeholders need to read or write tests: start with BDD using Cucumber, or keyword-driven tests with Robot Framework.
What is the Page Object Model and do I need it?
The Page Object Model (POM) is a design pattern where each page of your application has a class that holds the locators and actions for that page. You need it for any UI test suite with more than about 20 tests. Without it, maintenance becomes hard to manage.
How long does it take to build a test automation framework from scratch?
A basic modular framework can be running in 1–2 days. A production-ready hybrid framework with CI/CD integration, reporting and documentation usually takes 1–2 weeks. Rushing the setup tends to cost more later in maintenance.
Can I switch frameworks later?
Yes, but it is expensive. Migrating a medium-sized suite from one framework to another often takes several weeks. Make the choice carefully using the decision matrix in section 5. The most common migration is linear → modular when a project grows beyond its first scope.
Is BDD worth the overhead?
Only if non-technical stakeholders really read and contribute to the feature files. If only engineers ever open the .feature files, BDD adds maintenance overhead without the collaboration benefit. Be honest about whether that collaboration happens on your team before committing to BDD.
Want the runner, healing and reporting layers without building them? or .




