Understand UI automation, element selection, accessibility and result checks through a read-only order-status example with safe stopping rules.
UI automation is software that operates an application’s interface the way a person would: it finds controls, reads their state, enters input and checks the result. It has two uses. In operations, Viktor, an AI employee, uses a real cloud browser to fill in forms and download files in web tools with no integration. In testing, teams write Selenium, Playwright or Cypress scripts that repeat a user’s steps on each code change and fail when the result is wrong.
Browser automation works with web interfaces; desktop automation works with application windows and their controls. In both cases, a completed click is evidence of an interaction, not proof that the intended business result happened.
For an operations lead, a useful starting task is narrow and read-only: retrieve the status of one authorized demo order, confirm its identifier, and return the displayed status. That task makes element selection, waiting and verification concrete without introducing a financial or customer-facing change. A walkthrough of it follows later in this guide.
What UI automation is used for
UI automation can support work such as reading a status from an authorized portal, checking a report’s displayed filters or verifying that a screen shows an expected record. Software teams use it to check interface behavior during testing: an automated UI test opens the application, performs the steps a user would and asserts that the screen shows the expected result.
The defining feature is the interaction surface, not whether AI is involved. A fixed sequence can use UI automation. A system that chooses a next step from the current screen can also use it. Neither approach removes the need for permission or a measurable completion condition.
Browser and desktop interfaces have different structures. A browser exposes page elements through its document model and accessibility information. A desktop workflow instead needs support for the application’s windows and controls. Support depends on the application and the automation technology; identifying a browser button does not prove access to a desktop control.
The practical question is what the application exposes and whether the intended control can be identified unambiguously.
Benefits of automated UI tests over manual checks
Compared with a person clicking through the same screens before each release, an automated UI test offers:
- Speed and repeatability: the same steps run the same way on each run, and a suite can run while nobody watches.
- Accuracy: an assertion checks the exact text, value or state it names, so a check is not skipped because a tester is tired or rushed.
- Coverage: browser test tools can run the same test in several browsers, and a test runner can run tests in parallel.
- Earlier failures: in a pipeline, Cypress’s CI guide notes, “a change that breaks a user flow fails the build instead of shipping.”
- Cost: the effort of a repeated manual pass moves into writing and maintaining tests. Whether that pays off depends on how often the flow changes and how often you release.
The trade-off is upkeep. UI tests are slower than lower-level tests and need maintenance when the interface changes, which is why the section on the test pyramid below matters. We have not measured time saved or defects caught for any team, so this guide gives no percentages.
UI test automation and RPA
Two kinds of work drive an interface for different ends:
- UI test automation checks your own application’s behavior, for example inside a development pipeline. It is the main subject of the tool section below.
- Robotic process automation (RPA) is a category of business-process software that automates work across applications. Driving a user interface is one of its methods, and its goal is a completed business task, not a test result.
This guide uses “UI automation” in this general sense, not as the name of one vendor’s technology.
Popular UI automation tools
Viktor comes first here because he fits the operations reader’s task: a recurring check or form in a web tool that has no integration, done from a plain-language request, with nobody writing or maintaining locator code. His documentation says that when a task needs a website without an integration, he “uses a real browser in the cloud” and “can navigate pages, fill in forms, take screenshots and download files.” Viktor’s Screen lets you watch that browser live, take over when a site needs a person and hand it back, and replay a tab as a video afterwards when a recording was kept. Workspaces on EU data residency have no live view, take-over or replay.
Viktor is not a test framework and does not replace a regression suite for your own product. For testing your application on every code change, use a test framework. Three open-source options follow, listed alphabetically, not ranked.
Tool | What it is | Who writes the steps | Languages | Browsers | Recording or codeless option | Licence |
|---|---|---|---|---|---|---|
Viktor | An AI employee who uses a cloud browser when a tool has no integration | You describe the task in Slack, Microsoft Teams or the Viktor app; he does the steps | Plain language | His own cloud browser | No script needed; you can watch, take over and replay | Commercial service, plans on viktor.com/pricing |
Cypress | Testing for anything that runs in a browser; the Cypress App plus the Cypress Cloud service | Developers and testers | JavaScript and TypeScript test files | Firefox and Chrome-family browsers, including Edge | Cypress Studio records interactions; Studio AI suggests assertions (needs a Cypress Cloud account) | Cypress App is free and open source; Cypress Cloud is a paid service |
Playwright | Library and test runner for web automation and testing | Developers and testers | TypeScript, Python, .NET and Java | Chromium, Firefox and WebKit | Test generator records your actions and writes test code | Apache-2.0 |
Selenium | Browser automation project built on WebDriver | Developers and testers | Java, Python, C#, Ruby, JavaScript and Kotlin | Chrome, Firefox, Edge and Safari | Selenium IDE records and plays back actions | Apache-2.0 |
Sources: Viktor docs, Viktor’s Screen, Why Cypress, Cypress Studio, Cypress test files, Cypress TypeScript support, Cypress on GitHub, Playwright, Playwright test generator, Playwright on GitHub, Selenium, Selenium IDE, Selenium on GitHub. Read 1 December 2026.
Hand Viktor one browser check in a tool with no integration (up to $100 in free credits) →
How to choose by team skills
- No engineers, a task in a web tool without an integration: ask Viktor, and start with a read-only check you can verify.
- Developers who write JavaScript or TypeScript and test a web front end: Cypress or Playwright.
- A team that works in Python, .NET or Java: Playwright or Selenium.
- Tests that must run in Safari itself or across many machines: Selenium, which lists Safari among its browsers and whose Grid runs tests in parallel across multiple machines.
- Testers who prefer to record first and edit later: Selenium IDE, Playwright’s test generator or Cypress Studio, then review the generated code.
What is a test framework?
A test framework is the structure around automated tests: a way to write each test, a runner that executes them, assertions that decide pass or fail, and reports. Playwright describes its runner, Playwright Test, as a “full-featured test runner with auto-waiting, assertions, tracing, and parallelism.” A browser automation library alone drives the browser; the framework decides how tests are organized, run and reported.
Is Selenium still relevant in 2026?
Yes, judged by its own release record: Selenium’s downloads page lists version 4.54.0 as the stable release for its Java, Python, .NET, Ruby and JavaScript bindings, dated November 23, 2026. Its scripts can be written in six languages, and its Grid runs tests in parallel across machines. Playwright and Cypress both document automatic waiting built into their actions. We have no dated adoption or market-share data to compare the three, so this guide does not rank them.
Codeless, low-code and record and playback
People without coding skills can start UI automation with recording tools. Selenium IDE is “open source record and playback test automation for the web.” Playwright’s test generator records your actions and writes the test code, picking locators that prioritize role, text and test id. Cypress Studio generates and extends end-to-end tests by recording real interactions.
A recording is a first draft. Someone still has to decide what the test should assert, remove steps that depend on leftover data and keep the test working when the interface changes. A plain-language request to Viktor removes the code, not the need for a clear completion condition.
AI, visual and self-healing approaches
Tools now try to repair or write tests for you:
- Playwright ships three Playwright Test Agents: a planner that “explores the app and produces a Markdown test plan”, a generator that turns the plan into test files and a healer that “executes the test suite and automatically repairs failing tests.”
- Selenium IDE “records multiple locators for each element it interacts with. If one locator fails during playback, the others will be tried until one is successful.”
- Cypress Studio AI watches what changes in the interface while you record and recommends assertions for you to review.
- For visual checks, Playwright’s visual comparisons compare a screenshot with a stored reference image.
Treat an automatic repair as a proposed change. A healed locator that now matches the wrong button makes a test pass while the feature is broken, so review the change the way you would review code.
Elements, selectors and application state
A selector or locator describes the element the automation intends to use. A coordinate describes a position on a screen. Positions can change with window size, zoom or layout, so prefer a meaningful element description where the application supports one.
Playwright’s locator documentation, for example, recommends user-facing attributes and explicit contracts. Its role locators use information such as a control’s role and accessible name. A button named “Search orders” expresses more intent than “the third button.”
Meaningful names still need context. Two panels could each contain a “Search” button. A reliable interaction needs the relevant panel and exactly the intended control, not the first match that happens to appear.
What the accessibility tree contributes
The accessibility tree is a representation of accessibility-related information derived from the page. MDN describes properties including name, description, role and state.
That information can distinguish a button from a heading and an expanded section from a collapsed one. It does not prove the business meaning of a record. A heading called “Order details” could still belong to the wrong order.
Use accessibility information to understand controls, then verify the content associated with the requested task. Good labels benefit people using assistive technology as well as automation that relies on those labels.
Why waiting needs a condition
An element can exist before it is ready to use. A search control may be disabled while a request is processing, or a loading overlay may cover it.
Playwright documents actionability checks for its actions. A click requires conditions including a unique target, visibility, stability and an enabled element. If required checks do not pass within the configured timeout, the action fails.
Those are interaction checks. A separate assertion must establish that the expected result appeared. Waiting for “Order DEMO-1042” is more useful than assuming an arbitrary pause was long enough.
A first UI test, annotated
The example below is adapted from the test on Playwright’s Writing tests page, with our comments in place of the original ones. We did not run it for this article; it shows the shape of a test, not a result.
import { test, expect } from '@playwright/test';
test('get started link', async ({ page }) => {
// 1. Open the page under test.
await page.goto('https://playwright.dev/');
// 2. Find the element by role and accessible name (the locator), then click it.
// Playwright waits until the link is actionable before clicking.
await page.getByRole('link', { name: 'Get started' }).click();
// 3. Assert the result: a heading named "Installation" becomes visible.
// The assertion retries until the condition is met or the timeout passes.
await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible();
});Three parts carry the meaning. The locator (getByRole('link', { name: 'Get started' })) names the control the way a user sees it. The action (click()) is the interaction. The assertion (toBeVisible() on the expected heading) is the completion condition: without it, the test would pass after any click, even if the wrong page opened.
Why UI tests break, and how to keep them maintainable
UI tests break when something they depend on changes: a label is renamed, a layout moves a control, an animation delays it, a pop-up covers it or test data left by an earlier run changes what is on screen. The Practical Test Pyramid (Ham Vocke on martinfowler.com, 26 February 2018) puts it plainly: end-to-end tests “are notoriously flaky and often fail for unexpected and unforeseeable reasons.”
Practices that reduce breakage:
- Locate by role, name or test id, not by position or deep CSS paths, so a layout change does not break the test.
- Assert on results with waiting assertions rather than fixed pauses. Playwright says its async matchers wait until the expected condition is met.
- Keep each test independent, with its own data, so one failure does not cascade.
- Group page details in one place (Playwright documents this as page object models), so a renamed control is fixed once.
- Investigate before retrying. A retry hides a timing bug as easily as it absorbs a slow network.
When UI automation is the wrong layer
The Practical Test Pyramid summarizes Mike Cohn’s test pyramid as three layers, from bottom to top: unit tests, service tests and user interface tests. Its advice: “Write lots of small and fast unit tests. Write some more coarse-grained tests and very few high-level tests that test your application from end to end.”
Layer | What it checks | Speed | Flakiness | Use it for |
|---|---|---|---|---|
Unit | One function or class in isolation | Fastest | Lowest | Logic and edge cases |
Service or API | A component through its interface, without the screen | Medium | Low to medium | Business rules, integrations and data |
UI or end-to-end | The whole application through its screens | Slowest | Highest | A few critical user journeys |
Speed and flakiness are relative, as the source describes them, not measured figures.
The same logic applies outside testing. Before choosing UI automation for operations work, check whether an approved integration or supported API exposes the exact information required. Structured fields can make the completion condition explicit: the returned identifier matches the requested identifier, and the status field is present.
That is a design preference, not a claim that every API is complete or every interface is fragile. Confirm the particular operation, its permissions and its error behavior. Use the interface when it is the authorized surface available for the task or when the visible presentation itself needs checking. Do not treat an inaccessible API as permission to find another route to the same data.
For the broader choice between connection and browser work, when an AI employee should use a browser addresses the workflow decision. Element targeting and result checks remain necessary after that choice.
UI automation in a CI/CD pipeline
In continuous integration, each code change triggers a build that runs the automated tests, and a broken user flow fails the build instead of shipping. Cypress’s CI overview describes this: “every commit runs your end-to-end and component tests against your application.” Playwright’s CI guide says its tests “can be executed in CI environments” and provides sample configurations for common CI providers.
A workable setup:
- Run unit and API tests first, on every change, because they are fast.
- Run a small set of UI tests for critical journeys on every pull request, against a fresh test environment with known data.
- Run the wider UI suite on a schedule or before a release, in parallel where the tool supports it.
- Keep traces, screenshots or recordings of failures so someone can see what the screen showed.
- Give each failing test an owner, and quarantine a flaky test with a ticket rather than ignoring it.
This is a general pattern, not a configuration we ran for this article.
A small read-only order-status example
This illustrative example uses a fictional demo order and describes a proposed interaction, not a test against a customer account. The same steps apply whether a test script or Viktor does the work.
The task is: “In the approved demo portal, read the displayed status of order DEMO-1042. Return the identifier, status and observation time. Do not edit the order or contact anyone.”
1. Confirm the starting state. The authorized user has access to the designated demo environment. The automation checks that it is on the expected order-search page. A sign-in request, unexpected account or permission warning stops the task.
2. Identify the controls. The page has a field labelled “Order number” and a button named “Search orders.” The intended controls must be unambiguous within the search area. If the labels disappear or several controls match, report the mismatch.
3. Search for the supplied identifier. Enter only DEMO-1042 and activate the permitted search. Wait for a defined result state: a matching record, an explicit no-result message or an error.
4. Check the record before reading the status. The details panel must show DEMO-1042. A panel left over from a previous search is not acceptable evidence. Read the status associated with that identifier.
5. Produce a bounded result. A useful output might be: “DEMO-1042: Ready for dispatch, as displayed at the observation time.” Keep a link or a minimal redacted capture only where the task’s data policy permits.
The business outcome is a checked status ready for an internal review. It is not confirmation that the order shipped, that a customer was notified or that any underlying database changed.
A request should name the permitted source, expected output and review boundary. It should not assume Viktor controls every desktop application.
Try Viktor on one permitted status check (up to $100 in free credits) →
Handle timeouts and stop safely
A timeout means the expected condition was not established within the chosen limit. It does not mean the order does not exist.
Observed condition | Safe response |
|---|---|
Matching identifier and readable status | Return the checked status |
Explicit no-result message | Report that the approved search returned no match |
Loading state exceeds the limit | Report an incomplete lookup |
Several matching controls or records | Stop with the ambiguity |
Sign-in, permission or account warning | Stop for authorized access resolution |
Result identifier differs from the request | Reject the result and report the mismatch |
Set a bounded retry policy for temporary read failures. Do not retry indefinitely or change accounts to obtain a result. An unavailable answer is more accurate than a guessed status.
For future tasks that include writes, define a separate completion check against the saved record. A success banner or a click alone is insufficient. Financial actions, permission changes, destructive operations and outbound messages require specific human authorization.
Set permissions and the handoff before rollout
Give the workflow only the access the task needs. An order-status lookup does not need authority to issue refunds, alter addresses or export a customer list. Keep sensitive fields out of logs and captures unless they are necessary and explicitly authorized.
Assign an owner for interface changes. That owner should know what a failed lookup looks like and how incomplete work reaches a person. Review correctness and safe stops together; a workflow that stops on an unexpected account is preserving its boundary.
Understanding what an AI employee is also clarifies the handoff: specify the finished job, not an unlimited instruction to keep clicking until something works. Start with one record and one observable result, then expand only when the boundaries remain clear.
Ask Viktor for a status summary you can verify (up to $100 in free credits) →