Locate an image on the screen and perform an action.
match-image
command is used to locate an image on the screen by matching it with a reference image file and performing an action (For example, click or hover) at its center. This command is particularly useful for interacting with elements that the AI has difficulty locating using descriptions or other methods.
Argument | Type | Description |
---|---|---|
path | string | The path to the image that needs to be matched. The path needs to be relative to the current test file |
action | string | The action to take when the image is found. Available actions are: click , right-click , double-click , hover . Also supports drag-start and drag-end for dragging images |
match-image
command takes a screenshot of the desktop and searches for the location of the reference image within the screenshot.testdriver/screenshots/
directory.testdriver/screenshots/
) for dynamic resolution.path
needs to be relative to the current test fileโs directory. For example, if the test file is at testdriver/onboarding/login.yaml
and the image is present at the conventional testdriver/screenshots/nepal-flag.png
it should be referrenced asmatch-image
command is ideal for interacting with visual elements that canโt be reliably described or located using other commands like hover-image
.