How BugBug AI works
BugBug's AI capabilities are built into the test recorder and test execution engine. They activate automatically, during recording, before each test step, and at run time. You don't configure or enable them separately.
There are three AI features:
Feature
When it runs
What it does
Adaptive Locators
During recording
Generates the most stable selector for each element you click
Smart Click & Scroll
During test execution
Mimics real user behavior; handles dynamic, covered, or off-screen elements
Smart Waiting
Before every test step
Checks that the page and element are ready before acting
Adaptive Locators
When you click an element during recording, BugBug generates multiple selectors for it simultaneously and evaluates which is most likely to stay stable across UI changes.
Priority order:
data-testid/data-testand custom attributes defined by the user (most stable — tied to developer intent, not visual structure)Visible text content (e.g. a button labeled "Save")
Names, ids, semantic tags, roles and ARIA labels (e.g.
role="button",aria-label="Submit")Other
data-*Unique parent-related selector
CSS classes and IDs (only if stable — dynamic or auto-generated ones are deprioritized)
DOM position (last resort — most fragile)
BugBug skips dynamic values. The selected locator is stored with the test step. You can view and override it manually if needed.
BugBug also automatically prioritizes element attributes and properties that are unique on the page.
For example, if an element has a data-testid, but another earlier element uses the same value, BugBug treats it as non-unique. The selector then gets an index, making it less preferred because indexed selectors are more likely to break when the page structure changes.
When BugBug detects an indexed selector, it still tries to make it more reliable — for example, by finding a unique parent element and combining it with the target element selector. This can create a more stable selector path and move it higher in the selector priority order.
Smart Click & Scroll
BugBug simulates real cursor movement instead of dispatching JavaScript click events directly. This means:
It will not click an element that a real user couldn't click - if the element is covered by a modal, cookie banner, or overlay, BugBug detects this and retries.
It scrolls automatically - if the target element is outside the viewport, BugBug scrolls to bring it into view before clicking. You don't need to add scroll steps manually.
It avoids covered elements - if another element overlaps the target, BugBug scrolls the page until it finds a clear position where the target can be clicked safely.
It finds the clickable area - if the center of an element is covered, BugBug looks for an uncovered point within the element's bounds and clicks there.
It avoids accidental clicks on nested elements - if the target element contains another clickable element, BugBug finds a safe position within the target so the intended element is clicked, not the element inside it.
Learn more about Smart click →
Learn more about Smart scroll →
Smart Waiting
Before executing each step, BugBug checks a series of conditions. If they aren't met yet, it waits - up to the configured timeout - before proceeding.
Conditions checked automatically:
Document readyState is complete (Page has finished loading)
Page network requests are finished
Element must have expected attributes
Element exists in the DOM
Element is visible (not hidden with
display:noneorvisibility:hidden)Element is not animating
Element is not covered by the other one
Element must be active
Element has focus
Page URL has changed (for steps that trigger navigation)
Page will navigate after step execution
This is why you don't need manual sleep or delay steps in most cases.
You can view, enable, or disable individual waiting conditions per step, and set global defaults in Project Settings.
Learn more about Waiting conditions →
Security & AI FAQ
Last updated
Was this helpful?
