How to convert manual test cases into automated tests

Your team already knows what to test: it's in the test cases someone runs by hand before every release. This guide shows how to turn them into automated tests that stay reliable.

By Joseph Ofoma · 5 October 2026 · 8 min read

Most teams that want test automation don't have a "what to test" problem. They have hundreds of manual test cases in a spreadsheet or test management tool, and a regression cycle that takes days. The fastest path to useful automation is to convert those cases, not to start again from a blank page.

Below is the process we use, with a real example: test case TC-205, "Remove an item from the cart", automated with Cucumber, Serenity BDD and Selenium.

1. Pick the right test cases first

Not every manual test case is worth automating. Start with cases that are:

Leave exploratory testing, usability checks and one-off cases as manual work. Automation is for the repetitive checks that free testers to do that higher-value work.

2. Clean up the test case before you automate it

A manual test case written for a person often relies on context the person already has. Before automating, make sure each case has:

Here is TC-205 in that shape:

#ActionExpected result
1Open the cartThe cart shows Sauce Labs Backpack and Sauce Labs Bike Light
2Click "Remove" next to Sauce Labs BackpackBackpack is no longer in the cart; Bike Light still is
3The cart badge shows 1
4Click "Continue Shopping"The products page is shown

Preconditions: logged in as standard_user, with both products in the cart.

3. Map each step to Gherkin

Gherkin's Given, When and Then map neatly onto a manual test case: preconditions become Given steps, actions become When steps, and expected results become Then steps. Every expected result in the manual case should become at least one assertion. If a result isn't checked, the automated test is weaker than the manual one.

@ui @TC-205
Scenario: Remove an item from the cart
  # Preconditions
  Given I open the "Login" page
  And I type "standard_user" into "Username"
  And I type "${config:ui.password}" into "Password"
  And I click "Login button"
  And I click "Add to cart button" for "Sauce Labs Backpack"
  And I click "Add to cart button" for "Sauce Labs Bike Light"
  # Step 1
  When I click "Cart link"
  Then the texts of "Cart item names" should include:
    | Sauce Labs Backpack   |
    | Sauce Labs Bike Light |
  # Steps 2 and 3
  When I click "Remove from cart button" for "Sauce Labs Backpack"
  Then the texts of "Cart item names" should be:
    | Sauce Labs Bike Light |
  And "Cart badge" should have the text "1"
  # Step 4
  When I click "Continue shopping button"
  Then I should be on the "Products" page

Two details matter here. The @TC-205 tag links the scenario back to the manual test case, so you can always trace which cases are automated. And the password comes from configuration, not the feature file, so it can be supplied as a CI secret.

4. Reuse generic steps instead of writing new code

The biggest cost in a test suite is maintaining step definitions. If every test case gets its own Java steps, the suite grows faster than anyone can maintain it. A small set of generic steps, such as click, type, should have the text and should be on page, covers most UI and API test cases. You only write custom steps for genuinely complex flows.

This also makes tests readable by the whole team. A manual tester can review the scenario above against the original test case without reading any Java.

5. Use stable locators, kept out of the test

Element names like "Cart badge" are mapped to real locators in one YAML file per page:

# locators/cart.yaml
url: /cart.html
elements:
  Cart item names: "[data-test='inventory-item-name']"
  Continue shopping button: "[data-test='continue-shopping']"

Prefer data-test or data-testid attributes, then IDs, then CSS. Use XPath only when you need to match text. When the UI changes, you update one line in one file rather than every test that uses the element.

Don't guess locators from a screenshot. Capture them from the live page. EffortlessATF has a step, Then I capture the page as "Cart", that records every visible element with a suggested name and its most stable locator.

6. Never weaken an assertion to make a test pass

The manual test case is the specification. If the automated test fails because the application behaves differently from the expected result, that's a possible defect to report, not a test to "fix". Changing should be to should contain, or deleting an assertion, quietly removes coverage.

7. Run it, then run it again

A test that passes once isn't finished. Run it several times, and in parallel with the rest of the suite, to flush out timing problems. Avoid fixed sleeps: they make tests slow and still fail on a bad day. Use waits that poll until a condition is true instead. Our guide on Selenium waits without Thread.sleep covers this in detail.

8. Let AI do the typing, with guardrails

AI coding assistants are good at the mechanical part of conversion, mapping steps to Gherkin, but left alone they invent step definitions and guess locators. The fix is to give the AI a fixed vocabulary and check its work:

That's how EffortlessATF's AI workflow is built. It works with Claude Code, GitHub Copilot, Cursor and other agents. In practice, converting a case takes minutes rather than an hour, and the result reads like the scenario above.

Checklist

  1. Choose stable, repeatable, high-value cases.
  2. Make sure every step has an action and a checkable expected result.
  3. Map preconditions, actions and results to Given, When and Then.
  4. Tag each scenario with its test case ID.
  5. Reuse generic steps and keep locators in one place.
  6. Keep secrets in configuration, not tests.
  7. Never weaken an assertion; report the difference instead.
  8. Run repeatedly and in parallel before calling it done.

Try it with one of your test cases

Paste a manual test case into the live demo and watch EffortlessATF convert it into a scenario like the one above.