findAll() to find every coffee cup in an icon grid, clicks each one, and asserts on the result.
Watch it run
The test
findall-coffee-icons.test.mjs
How it works
findAll()returns an array with one element per match.- The description states how many to expect (βthere are exactly 4 on the pageβ).
- Each element has its position in
x,y,centerX, andcenterY. - Each element has its own
click(), so afor...ofloop clicks them in turn. - The test and assertion accept 3 or 4 matches, so one missed icon doesnβt fail the run.
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.

