couple o' screen captures questions

  1. When debugging an old script that you have written is there any easy way to browse your previous screen captures (double-clicking the screen capture name in the script window and having it appear in a new window would be VERY cool) - so you can refresh your memory about which capture is which and why your script may be having problems?

  2. Does the size (dimensions) of the captured image negatively effect the performance of the script? In other words if it would be just as easy and trouble free to select a little sliver of an image is that better than selecting a large square?

  3. If you create a “New Folder”, to organize your images in subfolders, in the “Capture Image in _______.suite” window will the suite/script never lose track of where those images are (say you have “buttons” and “forms” subfolders for the images associated with one script)? And related to this can you have images for one script in the root level of “Images” and ALSO in a subfolder of “Images”?

  4. Is there anything you can do if a script/suite loses track of where the images are located?



No, there’s no feature that does what you’re asking in the way you have described it. But if you look at any of your script results and click on specific lines that use images in those result logs, the image that was searched for will be displayed in the upper-right pane of the results tab. This is designed to let you compare the image used in the line that failed to the Screen_Error.tiff image that is captured at the time of the failure.

The time it takes Eggplant to locate an image on the screen is determined by a number of factors such as the dimensions of that screen, the actual location of the image, and the overall contrast of the screen. That said, it is generally a good idea to capture smaller areas of the screen for reasons unrelated to pure performance. If you capture an image that includes lots of the surrounding interface, you increase the chance that something included in that image will change or move and cause your script to fail.

For example, say you capture an image of a menu item that includes portions of the item above and below it. Now let’s say that you’ve forgotten that one of those other items sometimes has a checkmark next to it to indicate its current state. If something happens to cause that checkmark to appear before your next run, your script will fail because of a change in an item that you weren’t actually interested in.

To answer the second part of this question first, yes, you can have your images for a single script scattered throughout subfolders of the Images directory. To answer the first part, if you have images in a subfolder, any lines in your script that refer to those images must include the path from the Images directory to that subfolder. If you move images into and out of subfolders, any lines in your scripts that reference these images will need to be updated to reflect their new locations. So, yes, the scripts will “lose track” of the images if you move them around.

You probably won’t see this effect if you run a quick test because Eggplant caches the locations of the images when the Suite is loaded, so they will continue to be found where they were until you restart Eggplant. But when you restart Eggplant, the images old locations will be forgotten and their new locations will be cached.

There is nothing that can be done to automatically fix a script to reference the new location. The manual process is made a little easier if you use the following technique:

  1. Open the script and delete the “lost” image name from the command.
  2. With the script window still open, locate the image in its new location in the Images tab.
  3. Drag the imagename from the Suite window to where you need it in the script window. The image name will be added, including any necesary path information.

An alternative method is as follows:

  1. Open the script and delete the “lost” image name from the command.
  2. Click the Insert pulldown menu on the Script Editor window and select Additional Image.
  3. Navigate to the new location of the image and double click it to insert it in the command with its path information.

Hope that answers your questions.