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:
-
In the menu, click
.
-
Type a useful name for the asset into the
Name field and double-click
Silk4NET Image Asset.
The image asset UI opens.
-
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.
-
If you have selected to capture a new image, select the area of the screen that you want to capture and click
Capture Selection.
-
Optional: Click
Verify to check if
Silk4NET 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.
-
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.
-
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
Silk4NET 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.
-
Save the image asset.
The new image asset is listed
under the current project in the
Solution 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.