Watch it run
The test
element-not-found.test.mjs
How it works
- By default,
find()checks the screen every 5 seconds for up to 10 seconds. - When nothing matches,
find()doesnβt throw. - Instead, it returns an element whose
found()isfalseand whosecoordinatesarenull. - Calling
click()on an unfound element throws anElementNotFoundError.
Run it
The test is in the TestDriver SDK repository. Clone it, install dependencies, and run the file:TD_API_KEY. Create a key at console.testdriver.ai/team/api-keys. Then set it in your environment or a .env file.

