Search code examples
pythoniosappium

How to compare a picture in Appium, using Python code?


I need to compare template picture in iOS app. What syntax I need to use for it? I found so many information about it, but only with Java syntax.

I use Appium + Python on Mac.


Solution

  • I guess that you already retrieved the template image and the real image (to check against the template) by using the get_screenshot_as_base64() (here the documentation).

    Then you can try to use the OpenCV library embedded inside Appium to check how similar the two images are by calling the function get_images_similarity() (here the implementation) to get the similarity score of the two images and make reasoning on top of it.

    For more detailed information have a look at this useful article!