instanceof:
ElementNotFoundError: you acted on an element thatfind()didn’t locate.AIError: anai()task failed.
Error with a recognizable message. See Other errors.
ElementNotFoundError
Thrown when you call an action on an element thatfind() didn’t locate:
click(),doubleClick(),rightClick()hover()mouseDown(),mouseUp()
find() itself doesn’t throw when nothing matches. It returns an element whose found() is false. Check found() when the element might not be there:
Properties
The response from the
find() call, with screenshots and other large images removed. Includes fields such as cacheHit, similarity, and reasoning when the API returned them.Message
The message starts with the element’s description, then adds what TestDriver knows about the failedfind():
find() call, the debug block can also include:
- The cache threshold and the required similarity.
- When the cache was hit: the cache strategy, the entry’s age, and the pixel difference.
- The similarity score, marked
(below threshold)when it’s too low.
AIError
Thrown when a task you give toai() fails:
act() is the same method under another name and throws the same error.
Properties
Message
Other errors
These failures throw an error whose class isn’t exported. Check the message instead.Inside
ai(), a failed assert() resolves to false instead of throwing, so the AI can see the result and try another approach.Related
- find(): returns an element whose
found()tells you whether it was located - assert(): check what’s on screen
- Debug a failing test: find out why a test failed
- Events: listen for errors as they happen

