Image Not Found

After successfully creating and running several scripts, I have come back the next day to run them and EggPlant fails to find a number of images (see attachment).

Using the Image Doctor, it seems to have moved the image by a few pixels so it can't be located when using the original image capture.

This seems odd since they worked when originally created. I'm not sure whether it is due to something being mis-aligned on the page - although as I understand it, EggPlant tries to locate an image anywhere on the page, not the exact location where the image was captured.

Comments

  • EggplantMattEggplantMatt ForumAdmin admin
    This sort of shifting of elements by a pixel is quite common. It's for this reason that we recommend that images contain only single elements of the GUI. In your example, the label is one element and the field itself is a second element. There is a feature in eggPlant that is designed specifically to deal with this scenario: The hot spot (the little red crosshair) can be moved independently of the capture area. This allows you to capture an image of the field label, but have the mouse action occur in a location relative to the label.

    When you are selecting an image to be captured, you can hold down the control key (on Windows) or the command key (on the Mac) and move the hot spot independently of the capture area, either by dragging it or by simply clicking where you want to position it. So in this example, put the capture area around just the field label and then position the hot spot over the field, outside the bounds of the capture area. The hot spot determines where the mouse will actually be positioned when a command using the image is executed, so eggPlant will find the label using the captured image, but click to the left of it, where the hot spot is located.

    This also allows you to click in a populated field, regardless of its contents, making it useful for selecting elements like the URL field on a web browser. As you continue scripting with eggPlant, you'll likely find other scenarios where this relative hot spot technique is useful.
  • Thanks very much for your advice. Unfortunately I have already tried this.

    The issue seems to be it cannot locate the label (in this case the Email field), from which it can use the hot spot to click into the field, as the image has been moved a few pixels. This would appear to indicate that EggPlant is looking for the exact location of the capture image, rather than searching the entire page. Would you know if this is the case? Perhaps a setting has somehow been changed?
  • JonathanOSXJonathanOSX ForumAdmin admin
    Eggplant never searches for an image by coordinates. Even when you do the initial image capture and run your command it's doing a full screen search to locate the image. When you use the image doctor and it shows the original location that is for reference purposes only, it's never used for locating during a script command.

    Other things you should try -- if it's a text label you probably want to use the TEXT search type; you can find that if you open up the Info panel using the (i) button on the suite window.
Sign In or Register to comment.