Resizing Windows dialog

Some of my images captured on one machine don’t work on the other machine in the same OS (i.e. Windows XP) due to the images were captured within different size of Window. I tried to capture consistent images by resizing the window dialog to the same size by capturing the “X” button on the right top corner of the window and set the hotspot outside of it to make arrow cursor appear. Then use the draganddrop resizing to the given coordinates. But it didn’t seem to work. Could you please help me find an solution on this?


Capturing images of entire windows is usually not recommended for this reason. Is there some other way of verifying this step? Can you look for individual window elements, rather than the entire window?

WaitForAll "UIElement1", "UIElement2", "UIElement3"

-- OR

if not imageFound("UIElement1") or not imageFound("UIElement2") or not imageFound("UIElement3") then
	LogError "Panel not properly loaded"
end if

If neither of these approaches meets your needs, please post some sample images that show the problem you are having and the code that you have implemented and we can try to offer some other suggestions.

My problem is that the size of the image varies with the window dialog size (This varies when the application is running on different machine for the first time). I am looking for a way to make the window dialog size consistent so that the image size captured within the windows dialog will remain changed on different machine. My approach was to resize the window to my desired size so that the images captured under this condition will always be recognized. Is it possible to use Eggplant to resize windows dialog?


Eggplant can be scripted to do anything a user can do. So if the dialogue boxes are user-resizable then yes, you can write a script to resize the boxes to make them a uniform size.

However, outside of standard user behavior Eggplant doesn’t have the ability to directly affect changes to underlying object properties (like window size).

Yes, the window dialog boxes are resizable. Could you please suggest me a solution that I can make them a uniform size?

Well, if you can use an image to identify the upper left corner, then you can use coordinate math and drag the lower right corner to same location every time:

Drag "ResizeHandle"
Drop imageLocation("UpperLeftWindowCorner") + (400,200)

You should probably run this command against the machine you’re creating the script against before you capture the image you’re having trouble with to lock it in to the appropriate size.