I am testing an application with consists of a number virtual environments in several operating systems. One of the operating systems is Windows XPE. I am having image recognization problems due to the fact that “scaling” is turned on so that the screens will fit in a predefined format. This scaling caues the screens not to be displayed exactly the same every time. Sometimes an image is recognized, sometimes not, making the test script unreliable. Re-recording of failing images did not help solve the problem.
I have tried changing the tolerance from 45 to 70. This did not correct the problem. In my previous communications with Support, they said that the 45 setting was best setting and others may settng may give false positives or negatives.
The scaling was turned off to verify it as the source of the problem. It appears to be the source as scripts now would execute successfully.
Other than increasing the tolerance, is there another solution that I can try?
If you are talking about scaling of the remote screen then that is definitely not the issue. That ONLY changes how it’s displayed to the Eggplant user in the window. The actual image of the remote desktop is always at the full resolution.
The fact that toggling it seemed to make a difference actually suggests that you might have a timing issue where Eggplant is sometimes looking for the item before it has appeared. In general the best thing to do is look at your error screenshot to see the state of the SUT at the time of the image failure. Look and see if the image in the screenshot appears to be there:
If not, then it’s a timing issue and you should use a WaitFor or other timing mechanics (see Using Eggplant for suggestions).
if you can see the image then it’s possible that the image might appear in multiple states, in which case you should consider turning the image into a collection and capturing an image representation.
As always you are welcome to send your error screen shot and image in to support if that would help.
Can you manipulate the screen scaling at all? If you are displaying multiple environments simultaneously, similar to the screen capture below, you may want to cause eggPlant to manually scale the screens precisely so that the scaling ratio is always the same. Is that possible in your environment? Then start the tests.
One possibility is to use an external image editor to scale an image successively larger or smaller (and/or change the aspect ratio) until it matches the display, then batch convert the rest of the image library and use it for that run. Could be tricky though. (“GraphicConverter” is a good place to start.)
Otherwise, Jonathan’s suggestion to create collections of images that may be present is the way to go.
If I’ve missed your point altogether, please post a screen shot so we can see what you are dealing with.
jruuska & JonathanOSX
Thank you very much for your replies to my note. I will look into your suggestions.