
In this case the match will automatically fail. It can happen that the reference image you send in has dimensions which are larger than the screenshot Appium retrieves. OpenCV will not allow the matching of a reference image / template if that image is larger than the base image to match against. Turn this setting off if you know it's not necessary, and Appium will forego the check, potentially speeding things up a bit. If the screenshot retrieved (via Appium's native methods, or an external source) does not match the screen dimensions, this setting dictates that Appium will adjust the size of the screenshot to match, ensuring that matched elements are found at the correct coordinates. If you're matching the wrong element, try increasing the threshold value.Īppium knows the screen dimensions, and ultimately these are the dimensions which are relevant for deciding where to tap on the screen. It's recommended you try the default setting, and then incrementally lower the threshold if you're not finding matching elements. For example a match that requires drastic resizing of a reference image will come out as a lower match strength than otherwise. The exact values in between have no absolute meaning. Basically the range of possibilities is between 0 (which means no threshold should be used) and 1 (which means that the reference image must be an exact pixel-for-pixel match). The OpenCV match threshold below which to consider the find a failure. These are the settings that are available: Setting Name To access these settings, you should use the Appium Settings API.
#Appium app image software#
Related Settingsīecause finding elements by image relies on image analysis software in conjunction with Appium's screenshot functionality and the reference images you yourself provide, we provide a number of settings that help you modulate this feature, in some cases potentially speeding up the match or making it more accurate.

It's important to keep this important point in mind: there is nothing "magic" about Image Elements-they merely reference screen coordinates, and thus "tapping" an Image Element is internally nothing more than Appium constructing a tap at a point in the center of the Image Element's screen bounds (and in fact you can tell Appium which API to use to perform that tap-see below).

Other actions (like sendKeys, for example) are not supported, because all Appium can know based on your template image is whether or not there is a screen region which visually matches it-Appium has no way of turning that information into a driver-specific UI element object, which would be necessary for the use of other actions. These actions are supported on "Image Elements" because they are the actions which involve only use of screen position for their functioning.
#Appium app image how to#
How To Execute Shell Commands On The Remote Device.Activities Startup Troubleshooting Guide.
#Appium app image android#
