Skip to content

Test automation: where to start in a project

B2Bnetwork team · · 6 min

Testing and quality

In brief

Start test automation with a handful of stable, frequently repeated regression tests that eat the most manual effort today, not with choosing a tool. First set a goal (a shorter regression cycle, faster feedback after a change), then pick the layer: the API and business logic give the most value for the least effort. Before you write the hundredth test, the environment, test data, CI runs and a readable report must work. Without them, automated tests quickly stop being trusted.

When automation pays off and when it does not yet

An automated test costs you three times: when you write it, every time the application changes and every time it raises a false alarm. It pays back when it runs often and checks something that does not change every week. That makes regression tests the best candidates: the payment system after every release, the premium calculator after a tariff change, the export to accounting after a library update.

Automation does not pay off yet when:

  • the feature is still a prototype and its interface changes daily;
  • the test runs once a year, for example during a rare migration;
  • the result needs human judgment: how clear a message is, how a screen looks, how convenient a process feels;
  • there is no stable environment and no way to get repeatable data.

That last point is the most common reason for failure. The team writes scripts, but the test environment has different data every other day, so half the tests fail without any defect in the application. How to recognize and contain such tests is covered in the article on flaky tests.

First step: choose the tests to automate

Start with the list of manual regression cases and rate each one against a few questions. A simple spreadsheet is enough.

QuestionGood candidateWeak candidate
How often do we run this test?At every release or every changeOnce a quarter or less
How stable is the feature?Working for months, changes are rareBeing rebuilt in the current sprint
Can the result be checked automatically?An amount, a status, a database record, an API responseA judgment of layout or wording
What does a defect cost?Money, customer data, regulatory complianceCosmetics in a rarely used view
Can the data be prepared?A script creates the data before the testSomeone has to hunt for data in the environment by hand

Pick the 10–20 cases that score best and start with them. The risk analysis described in the article on risk-based testing helps with the order: areas with high impact and frequent changes get automated tests first.

Layer and tool

Tests below the user interface give the most value for the lowest cost. An API test that checks a fee calculation runs in seconds and rarely breaks. The same scenario clicked through a browser takes longer and fails whenever the screen layout changes. The proportions between layers are discussed in the article on the test pyramid.

A practical order for a typical business application:

  1. Unit tests are written by the developers together with the code. Test automation does not replace them.
  2. API and integration tests cover business rules, validations and cooperation with other systems.
  3. E2E tests in the browser or the mobile app cover a few of the most important customer journeys: sign in, purchase, submitting an application.

Pick the tool to fit the application and the team, not the other way around. What matters is the language the team already knows, browser and device support, CI integration and report quality. A comparison of the most popular E2E tools is in the article Playwright, Cypress or Selenium. The Playwright documentation recommends, among other things, testing user-visible behavior and keeping tests isolated from each other. Those principles hold whatever tool you use.

Foundations before you write the hundredth test

You can maintain the first ten tests without much order. Not the hundredth. Before the team speeds up, four things need to be in place.

  • Environment. A fixed version of the application, a known configuration and access to dependent systems or their mocks. A test should not depend on who happened to deploy something to the environment.
  • Test data. Each test creates the data it needs or uses a set that is restored before the run. Production data needs anonymization, as described in the article on test data and GDPR.
  • CI runs. Tests start on their own after every change or every night, and the result reaches the team without anyone asking. An automated suite that is run by hand “when there is time” soon stops being run at all.
  • Report. The report must show what failed, at which step and with which screenshot or log. A developer should not need to rerun the test to understand the defect.

On top of that, agree on shared rules for test code: the page object pattern or a step layer, naming conventions, and code review of test code just like production code. The ISTQB Test Automation Engineering syllabus devotes separate chapters to preparing the infrastructure, test automation architecture, integrating tests into the CI/CD pipeline, and reporting and metrics, which are exactly these foundations.

A plan for the first weeks

For a team that runs regression manually today, a sensible start looks like this:

  1. Set a measurable goal, for example cutting pre-release regression from three days to one.
  2. Pick 10–20 cases using the table above and describe their input data and expected result.
  3. Set up the skeleton of the test project: repository, environment configuration, CI runs and the report.
  4. Automate the first cases at the API level, then two or three key E2E scenarios.
  5. For a few weeks, run the automated tests alongside the manual ones and compare results. This builds trust.
  6. Remove from manual regression whatever stable automated tests cover, and only then extend the scope.

After each stage, measure what you promised in step 1: regression time, the number of defects found by automated tests, the share of false alarms. How to choose those numbers is described in the article on software quality metrics. An example of such a start in practice is Selenium and API test automation for a software house.

Questions and answers

How many tests should be automated?

There is no target percentage. You automate tests that run often, are stable and give an unambiguous result. In many projects that means most of the regression at the API level plus a few key E2E journeys. Exploratory testing, usability assessment and checking new features stay with people, because judgment matters there more than repeatability.

Can a manual tester start test automation?

Yes, if they get time to learn and support from someone who writes code. A manual tester knows the system and which scenarios matter, which is half the battle. The missing part (programming, version control and CI) can be filled in over a few months of work on a real project, ideally paired with an experienced test automation engineer.

Which tool should I start test automation with?

The one that fits the application's technology and the team's language. For web applications teams most often choose Playwright, Cypress or Selenium, for APIs a library in the team's language, for mobile apps Appium or the native tools. Test data, a stable environment and CI runs matter more than the tool's name.

How quickly does test automation pay off?

It depends on how often you run the automated tests and how much they cost to maintain. Count the hours of manual regression per release, multiply by the number of releases and compare that with the cost of writing and maintaining the tests. With weekly releases the payback usually comes sooner than with quarterly ones, but only if the tests are stable.

What it looks like in a project

Planning testing for your project? Talk to a test manager.

Let's talk

Read more: Testing and quality