Logging parameters for image lookup

Last edited on

Overview

To help analyze issues related to image-search ( findImage , waitForImage ) and to understand why Squish fails to look up an image as expected, the following Python script _helper_ImageSearch.py can be used to

Please download the helper script and save it in the Global Script directory.

To make the contents of a global script available to the test case script, add a source() call to your main function after launching the application, as shown below.

def main():
    startApplication("myaut")
    
    # Add this line to install helper functions that wrap the original waitForImage() and findImage() functions.
    source(findFile("scripts", "_helper_ImageSearch.py"))

    ....
	
    # Calling  waitForImage() and findImage() will perform the steps described above
    mouseClick(waitForImage("image_1", {"occurrence": 1, "timeout": 10000})) # exmaple code
	
test.py

Please note that once the helper script is sourced in main(), it overwrites the original findImage() and waitForImage() functions. If you want to use the original functions, call waitForImage_original() and findImage_original() instead.