How it works
You provide test steps, a target URL, and optional reusable flows. The AI generates a Playwright automation script that can be executed directly from TMS ONE. Results are tracked in Execution History.Quickest way: Automate directly from a test case
The fastest way to generate an automation script is directly from your test cases list — no need to navigate to the Test Builder manually.- Go to Test Cases in your project
- Find the test case you want to automate
- Click the magic wand icon (Automate) in the Actions column
- You’ll be taken straight to the Test Builder with the test case pre-linked and details pre-populated
- Add the Page URL, review the steps, and click Generate Test Script
Creating an automation script from scratch
1. Navigate to Test Builder
From the left sidebar, click Test Builder under your project. Note that Flow Library appears directly above Test Builder in the sidebar — if you have repeatable sequences across tests, set those up in the Flow Library first.2. Fill in the generation form
A name for the automation script.
Example: “Login flow - valid credentials”
Example: “Login flow - valid credentials”
The full URL of the page being tested.
Example:
Example:
https://yourapp.com/loginDefine the actions the automation should perform. Each step has three parts:
Click + Add Step to add more steps.The
Many step types display a
| Field | Description | Example |
|---|---|---|
| Action | What to do | click, type, toHaveText, toHaveURL |
| Selector | The CSS selector or XPath of the element to target | #email, button[type='submit'] |
| Value | A fixed value, a Scenario Table column key (variable mode), or a {{paramName}} token referencing a flow parameter | admin@example.com, expectedTitle |
The { } variable toggle
Many step types display a { } toggle button at the left of the Value field. Clicking it switches the step between literal mode (value is hardcoded) and variable mode (value is read from the Scenario Table at runtime).- Type / Select actions — variable mode links the value to a Scenario Table column key, so each scenario row provides a different input.
- Assertion actions (
toContainText,toHaveText,toHaveValue,toHaveCount,toHaveURL) — variable mode drives the expected value from a Scenario Table column, so different scenarios can assert different expected outputs.
Inserting a reusable flow
Click + Insert Flow above the steps table to insert a flow from the Flow Library. Select a flow, supply any required parameter values, and click Insert. The flow’s steps are inserted as a block in your steps list.If no flows appear in the picker, you will see a prompt linking you to the Flow Library to create one.Optional. Add multiple test data combinations to run the same script with different inputs. Each row is a separate scenario.Example:
You can also import scenarios from a CSV file.
| Scenario Title | password | |
|---|---|---|
| Valid admin login | admin@company.com | Admin123! |
| Valid user login | user@company.com | User123! |
Scenario-driven assertions
By default, assertions use a fixed expected value that is the same for every scenario. When you have a data-driven test where different scenarios should assert different values, you can drive the assertion from a Scenario Table column instead.Supported assertion actions
The following assertion actions support variable mode:| Action | What it asserts |
|---|---|
toContainText | Element contains the given text |
toHaveText | Element text exactly matches |
toHaveValue | Form input has the given value |
toHaveCount | Number of matching elements |
toHaveURL | Current page URL matches |
toHaveAttribute (requires two fields: attribute name and expected value) and getAttribute (retrieves a value rather than asserting) do not yet support variable mode.Setting up a scenario-driven assertion
- Add a step and choose an assertion action (e.g.
toHaveText) - Enter the element Selector
- In the Value field, click the
{ }toggle — it turns blue to indicate variable mode - Type the Scenario Table column key that holds the expected value for each scenario (e.g.
expectedTitle) - Make sure your Scenario Table has a column with that exact key name and a value in each row
Skip assertion when scenario value is empty
When a step is in variable mode, a “Skip assertion when scenario value is empty” checkbox appears below the Value field.| Checkbox state | Generated behaviour |
|---|---|
| Checked (default) | The assertion is wrapped in a guard — it is skipped entirely for any scenario row where the column value is blank |
| Unchecked | The assertion always runs, even if the scenario value is empty |
Example
Steps:| Action | Selector | Value | Mode |
|---|---|---|---|
| navigate | https://app.example.com/products | literal | |
| click | #search | ||
| type | #search | query | variable |
| toHaveText | .product-title | expectedTitle | variable |
| toHaveURL | expectedUrl | variable |
| Scenario Title | query | expectedTitle | expectedUrl |
|---|---|---|---|
| Laptop search | laptop | Best Laptop 2025 | /products?q=laptop |
| Monitor search | monitor | 4K Monitor | /products?q=monitor |
| No-URL check | tablet | Smart Tablet | (blank) |
toHaveURL step, the URL assertion runs for the first two scenarios and is skipped for the third.
Link to manual test case
Expand the Link to manual test case section to optionally associate this script with your manual test management records.Optional. Link Jira tickets if your Jira integration is configured.
Optional. Associate the script with one or more modules in your project.
Optional. Link to a specific manual test case for traceability.
3. Generate the script
Click Generate Test Script. The AI will produce a Playwright script based on your inputs, shown in the right panel.4. Review and edit
You can edit the generated script directly in the code editor before saving. This is useful for adjusting selectors, adding assertions, or tweaking logic.5. Save the script
Click Save Test Script. The script is saved to your project’s script history and is ready to execute.Managing saved scripts
Navigate to Test Builder → History to see all saved automation scripts for your project. From the history list you can:- View the full script and its metadata
- Edit the script code and update it
- Execute one or more scripts
- Regenerate a stale script (see below)
- Delete scripts you no longer need
Stale scripts
When a Flow Library flow that a script references has its steps or parameters changed, that script is automatically marked as Stale. A yellow warning badge appears next to the script title in the history list. A stale script is still executable — the existing generated code has not changed. The badge is a signal that the flow it was built from has since been updated, so the script may no longer reflect the current flow logic.Regenerating a stale script
Regeneration is supported for all script languages (JavaScript and C#). To bring a stale script up to date:- In the history list, find the script showing the Stale badge
- Click the Regenerate button (reload icon) in the Actions column
- Confirm in the prompt — the existing script will be overwritten
- The system re-resolves all flow references using the latest flow steps and re-calls the AI to produce a fresh script
Regeneration requires every flow referenced by the script to be in Active status. If a flow was set to Draft after the script was created, regeneration will fail with an error. Reactivate the flow in the Flow Library, then regenerate again.
Executing automation scripts
1. Select scripts to run
In the history list, use the checkboxes to select one or more scripts.2. Click Execute
Click the Execute button. The scripts are queued and run via the Playwright service.The Execute button is disabled while a run is already in progress. You’ll see an “Execution is in progress” indicator until it completes.
3. View results
Once execution completes, go to UI Test Runs to see pass/fail counts and download the full HTML report.Tips for better automation
Create flows for repeated sequences
Create flows for repeated sequences
If you find yourself typing the same login or navigation steps in every script, extract them into a flow in the Flow Library. Insert the flow instead — it’s faster to build and easier to maintain if selectors change.
Use stable selectors
Use stable selectors
Prefer IDs (
#elementId) or data attributes ([data-testid='login-btn']) over class names. These are less likely to break when the UI changes.Keep scripts focused
Keep scripts focused
Each script should test one flow. Avoid combining unrelated actions — it makes failures harder to diagnose.
Use scenario data for data-driven tests
Use scenario data for data-driven tests
Instead of creating multiple scripts for similar flows, add multiple rows to the scenario table. The same script runs once per scenario with different data. Use the
{ } variable toggle on assertion steps to assert different expected values per scenario — for example, asserting that a search for “laptop” lands on a different page title than a search for “monitor”.Link to your manual test case
Link to your manual test case
Linking a script to its manual test case keeps your test suite organised and makes it easy to trace which automation covers which requirement. Use the Link to manual test case section at the bottom of the form.
What’s next?
Flow Library
Create reusable step sequences to share across scripts
Execution History
View automation execution results and download reports