Checking for screen changes

I have a situation where an IE page on the SUT takes a while to go to the next page, but I need Eggplant to know when the screen has changed. The problem is the changes are data-driven so I can’t predict what new elements will show up on the next page, so I can’t have Eggplant look for any one particular image to signal that the screen has changed. I also want to avoid having Eggplant use Wait uneccesarily.

How do I have Eggplant know when a screen has changed without artificially setting a Wait time and without looking for any one particular image?


Most browsers have text or an icon that indicates when a page has loaded. In some, the “reload” button turns into a “stop” button while the page is loading. In IE, if the status bar is displayed, the message “Done” comes up at the bottom of the page. Your code might thus look like this:

Click "someLink"
WaitFor 30, "Done"

You could do the same thing with the Windows/Globe icon in the upper left corner of the browser.

The WaitFor is only going to hold the script up until the image is found.

Thanks! Using IE’s ‘Done’ message works. There is one exception: if the mouse pointer happens to appear over a link on the new page, the ‘Done’ message doesn’t appear. Instead you get the address of the link that just appeared. This can be fixed by moving the mouse to (0,0) right after the click. Occasionally the page changes too fast for this to work on its own… I found that setting the work interval to a shorter time solved the problem (I use the interval between clicks in a double click… works great).