Screen resolution in GUI testing

Hi

I read somewhere in Redstone's website saying sth like this:
"Eggplant does not rely on UI elements remaining in the same location but instead uses advanced searching algorithms to scan the screen of the other computer for the element you want to interact with. Changing the screen resolution just changes the number of screen pixels that are used to display each image pixel; the actual images normally do not change.
So changing screen resolution does NOT break the test."

I recorded my test in 1260x1024 and executed my test in 800x600. My test is considered passed if the desired screenshot appears at the end of the run. My test didn't pass as expected.

Eggplant failed to find my desired screenshot. The desired screenshot when recorded in 1260x1024 appears in the middle of the screen. When I ran it on 800x600, the same screenshot now has been moved down a bit. It no longer stays at the same position as it is. From Image Doctor, it showed me 2 different rectangles, the original one and the one that I see finally.

I'm a bit confused now. Shouldn't it be able to pass if I change my screen resolution? Can you please advice so that I can create my test in such a way that it won't be affected a change on screen resolution?

Thank you very much.

regards
Ai Choo

Comments

  • Ai, if my memory is refreshing correctly, you'll need to compare the target image at each expected resolution, just capture shots at each common resolution on your target systems and call them in a row, when you get a hit, the test passes.

    for example:

    shot1280,shot1024,shot800

    of course if my parity is faulty ( as it often can be right after startup) one of the guru's will be along shortly to tell you how it's really done :-)

    using the smallest possible element of the screen shot may increase chances of success, as does turning down the tolerance setting a bit.
  • JonathanOSXJonathanOSX ForumAdmin admin
    The images captured by Eggplant are not resolution dependent in nature. Eggplant is also definitely able to locate the same image regardless of where it appears on screen.

    However if your image is a particularly large one or is coming up in a viewer application that might be scaling the image then you will need to compensate.

    As Peter suggested capturing the smallest region you need to uniquely identify your image is usually a good practice.

    If your image is coming up scaled you might ensure that you select "full size" or whatever the equivalent might be in the application.

    Which doctor heuristic matched? You can choose to apply that "Fix" to the image permanently from the Action menu of the Doctor interface.
  • Hi

    I agree with you that it is a good practice to keep the image captured as smallest as possible, to make it less error prone during test run.

    One thing I forgot to mention in my earlier post is that: When I ran my test in 800x600, the screenshot has now moved downwards a bit, and not the whole desired image appears in the viewer screen. Part of the image is not visible. For this reason, I guess Eggplant failed to detect the whole image, thus the test failed.

    You recommend that I can snap a few screenshots in different resolutions (e.g. shot1280, shot1024, shot800 etc) and let Eggplant picks one from the given list. I think this approach is working.

    But I am just thinking whether there is a way to just capture 1 screenshot (say at the resolution of 1280x1024) and always pass the test in machines at different resolutions (e.g. 800x600, 1024x760)?

    regards
    Ai Choo
  • JonathanOSXJonathanOSX ForumAdmin admin
    Sure you can. But obviously if the whole image doesn't show up in the viewer you won't be able to verify the whole image.

    You could just capture the portion that shows up in 800x600 and you can most likely use that for higher resolutions as well (since they WILL be able to show the entire image).
Sign In or Register to comment.