Script can't find images

Hi All,

My script can’t find images after disconnected SUT and reconnected. I’ve verified that it is not caused by searching image time. I’ve captured image again every time I disconnected and reconnected SUT.

Please share if you have the same experience.

Best Regards,

Often this is just an issue of timing – If it looks like the image is there, there is a simple test to determine whether it wasn’t found because of timing or because it really is different from your test image:

When the script fails, before you do anything else, identify the line that it failed on and select it (it should already be selected). Now click the “Run Selection” toolbar item on the Script Editor window. If Eggplant finds the image when you do the run selection, then it is likely that the problem is one of timing; if it still doesn’t find the image, then something about that image is different than when it was captured – please send both the image and the failure ScreenError.tiff if you need help determining what changed.

You can correct for timing issues by a) adding a WaitFor before the step that is failing or b) adjusting the overall timing of Eggplant. If the problem is relatively consistent and in just a couple of places, a WaitFor will probably work. But if the problem is random and occurs frequently, then you probably want to slow down all of Eggplant’s interactions with the system-under-test. This is best accomplished by opening the Eggplant Preferences panel and under Run Options > System increasing the Remote Work Interval setting slightly, and/or under Run Options > Screen, increasing the Image Search Time a bit. Increasing the Remote Work Interval will slow everything down – it is the amount of time that Eggplant waits between sending events to the remote system. Increasing the Image Search Time has less of an effect on overall script execution times because it just gives Eggplant more time to look for an image when it needs more time – if the image is found quickly, Eggplant just moves on, just as happens with the WaitFor command.

Thanks Jonathan,

I did verified as you had mention. It is not timing issue. I did highlight the line that image can’t be found and then run selection. It still can’t find image. Do you have any idea why?

I’m very appreciated your valuable inputs.

Best Regards,

If the image contains text please be sure you are using the “Text” comparison type. You can set this by highlighting the image in the Suite and opening the Info Panel.

Other than that the UI element on the remote screen may have a number of subtly different states, instead of just replacing the image you might capture another copy of the image and then use Eggplant’s ____Any commands and provide the list of various images for the UI element.

Feel free to send in both the image itself and the ScreenError.tiff that is generated when the image fails to be found to support@redstonesoftware.com. We’ll be happy to analyze the image and see what the difference is.