I’ve got an issue when running on Windows 7 which is causing me lots of grief!
I was just wondering if anyone else has had a similar issue, or if its a known bug, is there a workaround etc…
The same scripts and setup did not have this issue when running on an XP box.
When an object does not exist and the script is attempting to click on it, or check for its existence the application is becoming hidden.
This is preventing any further interaction with the application. A click at any co-ords on the screen bring the app back into the foreground.
My attempted workaround was to set the ImageSearchCount to 1 (which prevents the auto ScreenRefresh and seems to resolve the hidden application issue) and have a number of custom functions for waiting for objects etc.
Unfortunately every now and again a ScreenRefresh is required to sort out some imaging issues after a drag and drop etc. which is affecting the reliability of the scripts I’m trying to run in a batch.
Can anyone help with this?
This is caused by Windows 7 “Show Desktop” feature. If you look at the right end of the task bar on Windows 7, you’ll see that there is a blank vertical area a few pixels across. If you put the mouse over this area, all of your windows in all of your apps will be hidden. When eggPlant doesn’t find an image on it’s first pass over the screen, its default behavior is to move the mouse to that same general area of the screen (which we’ve been doing since 2002 – Windows 7 introduced this window hiding feature just in the last couple of years).
There are several ways to address the issue:
- Right click on that “Show Desktop” area and change the settings so that it doesn’t do that anymore.
- Disable the eggPlant preference for “Should reposition mouse during image search”, either directly in the preferences (affecting all scripts you run going forward) or in the code on a script by script basis. There’s usually no unwanted side effects from doing this, so turning it off in the preferences is generally okay.
- Change the position that mouse is moved to when the “Should reposition mouse” setting is in effect. This can be done in code with a command like the following:
SetOption RepositionPoint, (1280, 1024)
SetOption RepositionPoint, remoteScreenSize() - (1,100)
Thanks Matt, thats a big help!