UI automation

On this page 7

UI automation is the technique of operating software through its graphical user interface by locating screen elements and simulating the clicks, keystrokes and reads that a person would perform. In RPA, it is the core mechanism that lets a software robot work with applications that offer no usable API, such as legacy desktop systems, terminal emulators and web portals.

Within automation as a whole, UI automation is the integration method of last resort: it reaches almost any application, but it depends on screens that were designed for humans, not machines. Understanding how it identifies elements and why it breaks is essential for anyone designing robotic process automation.

How UI automation finds and controls screen elements

A UI automation tool must first identify the target element, such as a button, text box or table cell, and then act on it or read its value. Identification usually relies on a selector: a description of the element built from attributes such as its name, control type, automation ID, window title and position in the element tree.

The tool obtains those attributes from the technology layer the application exposes. On Windows this is mainly the accessibility interface also called Microsoft UI Automation and its older predecessor MSAA; in browsers it is the Document Object Model; Java applications use the Java Access Bridge, and SAP GUI offers its own scripting interface. When no such layer is available, as in a remote Citrix session, the tool falls back to image recognition and OCR.

MethodHow it finds the elementRobustnessTypical use
Accessibility attributesReads names and IDs from the accessibility treeHigh if IDs are stableWindows desktop applications
DOM selectorsCSS or XPath queries in the browser pageHigh with stable IDs, low with generated classesWeb applications
Image matchingCompares screen pixels with a stored imageLow, sensitive to themes and scalingVirtual desktops without object access
OCR anchoringRecognizes text and acts relative to itMedium, depends on fonts and resolutionTerminal screens, scanned views
CoordinatesClicks a fixed screen positionVery lowOnly as a last fallback
Element identification methods and their robustness

Actions are delivered in two main ways. Hardware event simulation imitates real mouse and keyboard input and works almost everywhere but requires an active, visible session. Direct API input sets values or invokes controls through the technology layer, which is faster and works on minimized windows, but some applications ignore it.

Synchronization, waits and timing

Most UI automation failures are timing failures, not logic errors. A robot that clicks before a page has finished loading acts on an element that does not exist yet, while a fixed delay of several seconds wastes time on fast days and still fails on slow ones.

Robust designs replace fixed delays with condition-based waits: wait until an element appears, becomes enabled, disappears or contains a value, with a timeout typically between 10 and 60 seconds depending on the application. When the timeout expires, the robot should raise a defined business or system exception instead of continuing blindly, so that the case can be retried or handed to a person.

UI automation compared with other integration methods

UI automation is one of several ways to make systems exchange data, and it is rarely the most efficient one. The comparison helps decide when the user interface is the right integration point.

ApproachInterface usedSpeed and stabilityBest suited for
UI automationScreens designed for peopleSlower, sensitive to UI changesLegacy systems without APIs
API integrationDocumented programmatic endpointsFast and stable under versioningModern applications and SaaS
Database integrationDirect table accessFast but bypasses business rulesRead-only reporting with vendor approval
File exchangeCSV, XML or EDI filesReliable for batches, not real timePeriodic bulk transfers
UI test automationSame screens, assertion-focusedBuilt for repeatable test runsVerifying software quality, not running processes
UI automation and alternative approaches

The last row shows an important distinction. Test frameworks such as Selenium, Playwright and Appium use the same element-finding techniques, but they verify that software behaves correctly, while RPA uses UI automation to execute business work on production systems. In attended automation the robot shares the user’s screen; in unattended automation it needs its own interactive desktop session on a dedicated machine.

Designing UI automation that survives change

Because the interface can change with every application update, durable UI automation is a matter of selector discipline and environment control. The following decisions have the largest effect on maintenance cost.

DecisionRecommended choiceReason
Selector attributesStable IDs and names, not indexesIndexes shift when rows or tabs change
Dynamic valuesWildcards or variables in selectorsWindow titles often contain dates or record numbers
Screen settingsFixed resolution and display scalingImage and OCR matching depend on pixels
NavigationDirect URLs or shortcuts where possibleFewer steps mean fewer failure points
Element libraryCentral repository of reusable selectorsOne fix updates every process
CredentialsStored in a credential vaultAvoids passwords in scripts or logs
Design decisions for stable UI automation

Limitations and common mistakes

UI automation inherits every weakness of the interface it drives. Experienced developers plan for these problems from the first design session.

  • Brittleness after updates: a renamed button or redesigned page breaks selectors, so changes in target applications need a regression run of affected robots.
  • Unexpected pop-ups: session timeouts, cookie banners and update notices block the flow unless the robot detects and handles them.
  • Locked or disconnected sessions: hardware input fails when the screen is locked, which is a frequent cause of failed unattended runs.
  • Throughput limits: a robot cannot work faster than the application renders screens, so high volumes need parallel machines or an API.
  • Multi-factor authentication: interactive login prompts often require a service identity or an approved exception.

A plain-language summary

UI automation means teaching a computer to use another program the way a person does: look at the screen, find the right box, type a value and press the button. It is useful when two programs cannot talk to each other directly, because the screen is the only door into one of them.

The robot does not really see like a person. It recognizes buttons and fields by their hidden labels or by pictures of them, so if a program changes its look, the robot can get lost. The key point is that UI automation is flexible but fragile, and it works best for stable screens.

An example from practice

An insurance company processes address changes in a policy administration system built two decades ago, which has a Windows desktop client and no external API. Clerks used to retype each change from an email form into four screens.

An RPA team builds an unattended robot that reads the request from a queue, opens the client, searches the policy by number and fills the address fields using accessibility-based selectors with stable control IDs. Each step waits for the next screen to appear, with a 30-second timeout, and any policy that cannot be found becomes a business exception for a clerk. The robot runs on two virtual machines with fixed resolution and processes routine changes overnight, while staff handle only the unusual cases the following morning.