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 relative path to the image file that needs to be matched on the screen. don’t include testdriver/screenshots/*/ in the path. |
action | string | The action to perform when the image is found. Available actions are: click or hover . The action will be performed at the center of the matched image. |
match-image
command takes a screenshot of the desktop and searches for the location of the reference image within the screenshot.testdriver/screenshots/(mac/linux/windows)/
directory. TestDriver dynamically resolves the correct image based on the current platform.testdriver/screenshots/(mac/linux/windows)/
) for dynamic resolution.match-image
command is ideal for interacting with visual elements that can’t be reliably described or located using other commands like hover-image
.