Edit.Get(image) command

Identifies an edit field based on an image label and retrieves its value. The value can be inserted into a defined variable.

The field is in relation to the found label and is defined by the label position and offset parameters. For more information, see Visual Relations.

By default, the find image function searches for the image on the current screen. However, if there is a possibility that the image is not on the current screen, enable the Scroll and search parameter. When enabled, the default scroll direction is down. For iOS devices, the default scroll direction is right. To change the scroll direction to down, select body in the Search area parameter.

For more information on how to use the Next parameter, see Create custom swipe gestures

Parameters

Name Type Possible values Description

Device ID*

Device

 

The device for this command.

Label*

Media

 

The image that appears on, or related to, the edit field.

The image should be in JPEG, PNG, or BMP format.

You can select a file that already resides in the Perfecto repository or select a file from your computer that is then uploaded to the Perfecto repository. To learn more about the Perfecto repository, see Manage the repository. Click the Select media link, browse to the file, and then click SELECT.

Label position

String

Left | Right | Above | Below | Left-Above | Left-Below | Right-Above | Right-Below

The label position relative to the edit field.

  • Left: The label is to the left of the searched edit field.

  • Right: The label is to the right of the searched edit field.

  • Above: The label is above the searched edit field.

  • Below: The label is below the searched edit field.

  • Left-Above: The label is to the left and above the edit field.

  • Left-Below: The label is to the left and below the edit field.

  • Right-Above: The label is to the right and above the edit field.

  • Right-Below: The label is to the right and below the edit field.

Label offset

String

 

This value can be in pixels or in percentage of screen height (0-100). For percentage, use the % sign. Example: 20%

Used alongside the Label position parameter. If the label position is None, then the label offset is 0. Otherwise, the label offset default is 10%.

Label inline

String

Horizontal | Vertical | None

The label alignment, in line with the edit field.

When the Label position is Left or Right, the default is Horizontal.

Lines

Number

 

The number of text lines to be retrieved from the edit field.

Result variable

String

 

The variable name to receive the edit field text. The text will always be available in the report.

Analysis source

String

Primary | Native | Camera | Auto

The source for retrieving the screen content.

  • Primary: The screenshot taken from the device (higher resolution but slower performance).

  • Native: Native device controls.

  • Camera: The screenshot is taken from the video stream (lower resolution but faster performance).

  • Auto: Native device controls, if available. Otherwise, digital screen image, if available. Otherwise, analog screen image.

Timeout

Number

 

The time, in seconds, to wait for the label to appear.

For a dynamic screen, specify the expected waiting time for the label to appear. Example: page load time

The timeout contains the system analysis time. For this reason, consider specifying at least 20 seconds.

Report

String

All | All on error | Screenshot | Screenshot on error | Text | None

The value to display in the report.

Screenshot: Displays screenshots.

Screenshot on error: Display screenshots only for actions in error.

Text: Displays screen text.

All: Displays screenshot and text.

All on error: Always displays text and but only displays screenshots for actions in error.

None: Display nothing.

Consider reducing the resolution in very long scripts that result in large report files.

Threshold

Number

 

The acceptable match level percentage, between 20 and 100.

Values that are too low can lead to a false positive result, while values that are too high can lead to a false negative result.

Scroll and search

String

False | True

Scrolls until the label is found. Scroll cannot be used together with a positive timeout value because the parameters dictate a different behavior when the needle is not found. When scrolling is enabled, the timeout must be zero.

Scroll results in a longer execution time.

Max scroll

Number

 

The maximum number of scroll actions to perform before returning.

Finding the label will stop the scrolling.

Effective values are in the range of 0-100.

Repository key

String

 

The full repository path, including directory and file name, where to save the screen text.

When using commands that utilize files from the repository, the paths to the files are specified as repository keys. A repository key consists of the subarea and the path to the file.

For example, to specify a file called myImage.jpg stored in the images folder located in the PRIVATE subarea, specify the key as PRIVATE:images/myImage.jpg.

The text will always be available in the report.

Label top

String

 

The top value of the image area defining the label.

The value is in pixels. Default is the entire image.

Label height

String

 

The height value of the image area defining the label.

The value is in pixels. Default is the entire image.

Label left

String

 

The left value of the image area defining the label.

The value is in pixels. Default is the entire image.

Label width

String

 

The width value of the image area defining the label.

The value is in pixels. Default is the entire image.

Match mode

String

Same size | Any size | Bounded size

The needle comparison method.

  • Same Size: Needle and haystack are from the same origin (device screen) and size. Matching is faster and simpler.

  • Any Size: Needle and haystack are either not from the same origin (needle is from another device or another source) or not in the same size (different ratio or size). Matching is slower and more complex.

    Selecting Any Size increases the analysis time. The timeout values should be increased accordingly.

  • Bounded Size: Same as Any Size with restrictions on possible needle sizes. This mode can decrease the Any Size analysis time by using apriori knowledge on needle sizes or by decreasing the size of a haystack.

OCR - profile

String

Default | Document Conversion Accuracy | Document Conversion Speed | Document Archiving Accuracy | Document Archiving Speed | Book Archiving Accuracy | Book Archiving Speed | Text Extraction Accuracy | Text Extraction Speed | Field Level Recognition | Barcode Recognition

Use when text cannot be found on the device screen.

Try all profiles with the word accuracy. Per profile, try changing the DPI (96 or 300 or 120).

OCR - Analysis mode

String

Full | Automatic | Manual

The image analysis mode. The device screen may contain text and images.

  • Automatic: OCR distinguishes between text and images, filtering out images.

  • Manual: OCR assumes text only. Use alongside the Inverted text parameter.

  • Full: OCR tries both automatic and manual.

This parameter is not relevant when using native screen source.

OCR - Inverted text

String

Any | Yes | No

The text appearance, likely to appear in inverted colors (dark text on light background). Use only if 'Analysis mode' is set to 'Manual'.

  • Yes: Text is inverted

  • No: Text is normal, not inverted

  • Any: Text might be inverted or not, checked automatically by the system

This parameter is not relevant when using native screen source.

Haystack top

String

 

The top value of the screen area where to search for the label.

Values can be in pixels or in percentage of screen width (0-100). For percentage, use the % sign. Example: 20%

Default is to search the entire screen.

Consider reducing the resolution in very long scripts that result in large report files.

Haystack height

String

 

The height value of the screen area where to search for the label.

Values can be in pixels or in percentage of screen width (0-100). For percentage, use the % sign. Example: 20%

Default is to search the entire screen.

Consider reducing the resolution in very long scripts that result in large report files.

Haystack left

String

 

The left value of the screen area where to search for the label.

Values can be in pixels or in percentage of screen width (0-100). For percentage, use the % sign. Example: 20%

Default is to search the entire screen.

Consider reducing the resolution in very long scripts that result in large report files.

Haystack width

String

 

The width value of the screen area where to search for the label.

Values can be in pixels or in percentage of screen width (0-100). For percentage, use the % sign. Example: 20%

Default is to search the entire screen.

Consider reducing the resolution in very long scripts that result in large report files.

Visual relation direction

String

Left | Right | Above | Below | Left-Above | Left-Below | Right-Above | Right-Below | Inside

The direction of the related region, stored in memory from the last found needle, in relation to the searched needle.

  • Left: The related region is to the left of the searched needle.

  • Right: The related region is to the right of the searched needle.

  • Above: The related region is above the searched needle.

  • Below: The related region is below the searched needle.

  • Left-Above: The related region is to the left and above the searched needle.

  • Left-Below: The related region is to the left and below the searched needle.

  • Right-Above - The related region is to the right and above the searched needle.

  • Right-Below: The related region is to the right and below to the searched needle.

  • Inside: The searched needle is inside the related region boundaries of the related region.

For more information, see Visual Relations.

Visual relation inline

String

Horizontal | Vertical

The search area is in-line with the related region, stored in memory from the last found needle.

For more information, see the Visual Relations series.

  • Horizontal: The needle is within the height (top to button) boundaries of the related region

  • Vertical: The needle is within the width (left to right) boundaries of the related region

Report image resolution

String

High | Medium | Low

The image resolution.

Consider reducing the resolution in very long scripts that result in large report files.

OCR - Languages

String

English | Spanish | Japanese | German | French | Dutch | Italian | Chinese | Russian | Portuguese

The OCR language to use.It is possible to select multiple languages.

For languages that do not appear in the drop down menu, please contact Perfecto Mobile Support to enable.

This parameter is not relevant when using native screen source.

OCR - Policy

String

auto (Auto) | accuracy (Accuracy) | performance (Performance)

The text recognition accuracy policy.

Selecting the Accuracy value will increase the operation time.

  • Auto: shifted toward recognition accuracy with a moderate impact on the recognition speed.

  • Accuracy: shifted toward maximum recognition accuracy.

  • Performance: shifted toward recognition speed.

This parameter is not relevant when using native screen source.

Use cache

String

Use | No Use

Indicates whether the text recognition application should use a cached picture of the screen if available (this value should not be changed by the user, under normal circumstances).

Interval

Number

 

The minimum time interval, in seconds, for a single analysis.

If the analysis operation takes less than the interval, wait the remaining time before the next analysis operation.

Backlight

String

 

The key sequence to perform the backlight operation.

Example: VOL_UP

For best practice, use a key that will not change the screen.

Next

String

SWIPE_UP | SWIPE_DOWN | SWIPE_RIGHT | SWIPE_LEFT | UP | DOWN | RIGHT | LEFT

The key sequence to perform the scroll operation.

For more information see Swipe Gesture in Analysis Functions.

Grid label

String

 

The column name to be used for grid view in the report.

Selecting this parameter creates the grid report.

Needle bound

Number

 

The ratio in percentage by which the original needle width may vary. The ratio is defined as a (100 - specified percentage) / 100.

Needle sizes to be checked by the analysis will be limited to the range from original needle width multiplied by the ratio to the original needle width divided by the ratio.

To use this parameter, Match mode must be bounded size.

Haystack area

Number

 

The size of haystack to be used for the analysis. The haystack image will be scaled before being analyzed so its area does not exceed the specified value. Haystack images that do not exceed the value will stay unchanged.

To use this parameter, Match mode must be set to Bounded size.

Comment

String

 

Adds a comment to the script

On-fail Result*

Condition

Ignore | Break | Continue | Abort | Catch

The behavior when the command fails.

* Mandatory parameter