13 Image Based Recording Functional Module

This chapter provides a complete listing and reference for the methods in the OpenScript Image based recording Class of the OpenScript Application Programming Interface (API).

13.1 Image Based Recording API Reference

The following section provides an alphabetical listing of the methods in the OpenScript Image based recording API.

13.1.1 Alphabetical Command Listing

The following table lists the Image based recording API methods in alphabetical order.

Table 13-1 List of Image Based Recording Methods

Method Description

img.target

Identifies a target screen capture image by its filename, offset coordinates, and threshold.


The following sections provide detailed reference information for each method in the Image based recording Module Application Programming Interface.

img.target

Identifies a target screen capture image by its filename, offset coordinates, and threshold.

Format

The img.target method has the following command format(s):

img.target(imageName, threshold);

img.target(imageName, threshold, title);

img.target(imageName, offsetX, offsetY, threshold);

img.target(imageName, offsetX, offsetY, threshold, title);

Command Parameters

imageName

a String specifying the target image name and location. Image files are recorded to the ImageLib folder under the script's resources folder. The image name can be specified using the {{@resourceFile(ImageLib/filename.png)}} transform.

offsetX

a value specifying the X-offset coordinate where to perform the image action within the screen capture boundaries. The upper left corner of the capture image is the 0 point.

offsetY

a value specifying the Y-offset coordinate where to perform the image action within the screen capture boundaries. The upper left corner of the capture image is the 0 point.

threshold

a double value specifying a threshold of similarity to use when comparing the recorded screen capture image to the screen that appears during playback.

title

a String specifying the image title.

Throws

AbstractScriptException

represents an exception that may be thrown during the execution of a script where the exception should be reported to an end user through the controller.

Example

Clicks on a target area of the screen identified by the screen capture image.

img.target("{{@resourceFile(ImageLib/0.png)}}",
 45, 49, 0.9, "Image Title")
 .click();