Skip to main content
Describe an element the way a person would, and find() locates it on screen. No selectors, IDs, or DOM access.
find() returns an element. You can act on it with methods like click() and hover(). See Perform actions.

Describe the element

A good description has up to three parts:
  1. What it says. The visible label or text, such as “Sign in” or “Add to cart”.
  2. What it is. A button, an input field, an icon, a link, a checkbox.
  3. Where it is, when there’s more than one match. A position, a color, or a nearby element.
A few more tips:
  • Lead with visible text. Text on screen is the most reliable thing to match.
  • Describe icons by how they look. “Shopping cart icon in the top right corner” works better than “cart link”.
  • Keep changing values out. A description with a changing name or ID never reuses the cache. Describe the element itself instead.
  • Describe one element. For a list of matches, use findAll().

Check whether it was found

find() keeps checking the screen every 5 seconds for up to 10 seconds. If nothing matches, it doesn’t throw. It returns an element whose found() is false:
Acting on an element that wasn’t found throws an ElementNotFoundError. For something slow to appear, raise the timeout:

Make the match stricter

When finding the wrong element is costly, find() has options to tighten the match:
Each option adds time or makes a miss more likely, so use them where accuracy matters most. See find() for details.

Find every match

findAll() returns an array with one element per match:
See the find all example for a complete test.

Inspect a result

An element tells you where it was found and how sure the AI was:
For more detail, serialize the element. toJSON() adds the AI’s reasoning and whether the result came from the cache:

Next steps

find()

Every option, with examples.

Perform actions

Click, type, and scroll once you’ve found an element.

Caching

Reuse element positions from passing runs.

Debug a failing test

See what the screen showed when find() missed.