Creating an Image Asset

You can create image assets in one of the following ways:
  • By inserting a new image asset into an existing script.
  • During recording.
  • From the menu.

To create a new image asset from the menu, perform the following steps:

  1. In the menu, click Silk4J > New Image Asset.
  2. Select the project, to which you want to add the new image asset, and type a meaningful name for the asset into the Name field.
  3. Click Finish. The image asset UI opens.
  4. Select how you want to add an image to the asset.
    • If you want to use an existing image, click Browse and select the image file.
    • If you want to capture a new image from the UI of the application under test, select Capture. If you are testing a Web application, you can select the browser on which you want to capture the image from the Select Browser window.
    • If you want to capture a new image after a delay of three seconds, for example to expand a menu in the application under test before the image is captured, select Capture with Pause.
  5. If you have selected to capture a new image, select the area of the screen that you want to capture and click Capture Selection.
  6. Optional: Click Verify to check if Silk4J can find the image asset in the UI of the AUT. If you are testing a Web application, you can select the browser on which you want to capture the image from the Select Browser window.
  7. Optional: Check the Click position check box to select the location on which any clicks on the image asset are performed. The default location is the center of the image. Type the location into the x and y fields or select the location on the image.
  8. Specify the Accuracy Level. The accuracy level defines how much the image to be verified is allowed to be different to the image in the application under test, before Silk4J declares the images as different. This is helpful if you are testing multiple systems or browsers with different screen resolutions. We recommend to choose a high level of accuracy in order to prevent false positives. You can change the default accuracy level in the options.
    Note: When you set the Accuracy Level to less than five, the actual colors of the images are no longer considered for the comparison. Only the grayscale representations of the images are compared.
  9. Save the image asset.

The new image asset is listed under the current project in the Package Explorer, and you can use it to perform image clicks.

You can add multiple images to the same image asset.

Note: To add an image click while recording against a mobile browser, you can right-click in the Recording window and select ImageClick from the action list.