Legacy | Edit.Set image

  • Command: edit-image

  • Subcommand: set

  • Supported Platforms: Native (legacy), UFT (legacy), Selenium, Appium

    All commands must be executed using the same framework. Sharing the execution ID between different frameworks is not possible. This means that if you work with a Selenium/Appium driver, you need to call the commands using the Selenium/Appium driver (or, in the case of Reporting commands, through the Reporting SDK that works with the driver) and not as part of a UFT test or another framework.

  • Supported OS: Android, iOS

Description

Identifies an edit field based on an image label and inserts the text specified in the value parameter into the field. The field is in relation to the found label and is defined by the label position and offset parameters.

By default, the find text function searches for the text on the current screen. However, if there is a possibility that the selected text 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

This command should be used in combination with Visual Relations.

Parameters

Name Value Default Description
deviceId*     The device for this command.
label*    

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

Image should be in JPEG, PNG or BMP format.

text*    

String - The text to insert in the edit field.

Secured String - The encoded text to insert in the edit field.

The text can be in any language.

label.direction

left (Left)

right (Right)

above (Above)

below (Below)

none (Inside)

leftmost (Leftmost)

rightmost (Rightmost)

 

The label position relative to the edit field.

Used alongside the Label offset parameter.

Rightmost and Leftmost Label position values represent the distance from screen edge.

Inside - The label is part of the edit field

Above - The label is above the edit field

Below - The label is below the edit field

Left - The label is to the left of the edit field

Right - The label is to the right of the edit field

LeftMost - The edit field is aligned to the right, and its label is to the left

RightMost - The edit field is aligned to the left, and its label is to the right

label.offset

 

 

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 label position is "none", then label offset is "0". Otherwise, label offset default is 10%.

source

primary (Primary)

native (Native)

camera (Camera)

auto (Auto)

secondary ()

 

The source for retrieving the screen content.

Primary - Screenshot taken from the device (higher resolution but slower)

Native - Native device controls

Camera - Screenshot taken from the video stream (lower resolution but faster)

Auto - Native device controls, if available. Else, digital screen image, if available. Else, analog screen image.

operation

single (Single tap)

double (Double tap)

long (Long tap)

roll (Trackball roll)

none (No touch)

 

The touch operation to perform on the found label location.

timeout

 

20

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. For example, the page loading time.

The timeout contains the system analysis time, for this reason it is recommended to specify at least 20 seconds.

threshold

   

The acceptable match level percentage, between 20 and 100.

Too low values can lead to a false positive result, while too high values can lead to a false negative result.

scrolling

noscroll (False)

scroll (True)

False

Scroll until the label is found.

Scroll cannot be used together with a positive Timeout, because they dictate a different behaviour when the needle is not found. When scrolling is enabled, the timeout must be zero.

Scroll results in a longer execution time.

maxscroll  

5

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.

image.top

   

The top value of the image area defining the label.

Value is in pixels. Default is the entire image.

image.height

   

The height value of the image area defining the label.

Value is in pixels. Default is the entire image.

image.left

   

The left value of the image area defining the label.

Value is in pixels. Default is the entire image.

image.width

   

The width value of the image area defining the label.

Value is in pixels. Default is the entire image.

screen.top

   

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.

It is recommended to reduce the resolution in very long scripts that result in large report files.

screen.height    

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.

It is recommended to reduce the resolution in very long scripts that result in large report files.

screen.left

   

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.

It is recommended to reduce the resolution in very long scripts that result in large report files.

screen.width

   

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.

It is recommended to reduce the resolution in very long scripts that result in large report files.

match

identical (Same size)

similar (Any size)

bounded (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 other 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 respectively be increased.

Bounded Size - same as Any Size with restrictions on possible needle sizes. This mode allows decrease the any size analysis time by using apriori knowledge on needle sizes or by decreasing the size of a haystack.

matchGeneric

   

A generic image compare parameter.

Use this to provide additional image compare specifications that are not exposed as function parameters.

Examples:

matchMethod=TM_SQDIFF_NORMED

matchMethod=TM_CCORR_NORMED

relation.direction

left (Left)

right (Right)

above (Above)

below (Below)

left-above (Left-Above)

left-below (Left-Below)

right-above (Right-Above)

right-below (Right-Below)

inside (Inside)

 

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

For more information, see the Visual Relations series.

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

relation.inline

horizontal (Horizontal)

vertical (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

interval

 

0

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

   

The key sequence to perform the backlight operation.

Example - VOL_UP

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

next

SWIPE_UP (SWIPE_UP)

SWIPE_DOWN (SWIPE_DOWN)

SWIPE_RIGHT (SWIPE_RIGHT)

SWIPE_LEFT (SWIPE_LEFT)

UP (UP)

DOWN (DOWN)

RIGHT (RIGHT)

LEFT (LEFT)

 

The key sequence to perform the scroll operation.

For more information, see Swipe Gesture in Analysis Functions.

report

screenshot (Screenshot)

screenshot-on-error (Screenshot on error)

none (None)

Screenshot

The value to display in the report.

Screenshot - display screenshot

Screenshot on error - display screenshots only for actions in error

None - display nothing

It is recommended to reduce the resolution in very long scripts that result in large report files.

report.resolution

high (High)

medium (Medium)

low (Low)

High

The image resolution.

It is recommended to reduce the resolution in very long scripts that result in large report files.

profile

default (Default)

DocumentConversion_Accuracy (Document Conversion Accuracy)

DocumentConversion_Speed (Document Conversion Speed)

DocumentArchiving_Accuracy (Document Archiving Accuracy)

DocumentArchiving_Speed (Document Archiving Speed)

BookArchiving_Accuracy (Book Archiving Accuracy)

BookArchiving_Speed (Book Archiving Speed)

TextExtraction_Accuracy (Text Extraction Accuracy)

TextExtraction_Speed (Text Extraction Speed)

FieldLevelRecognition (Field Level Recognition)

BarcodeRecognition (Barcode Recognition)

 

Use when text cannot be found on the device screen.

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

ocr

   

A generic OCR parameter.

Use this to provide additional OCR specifications that are not exposed as function parameters.

Example - "isolate=true" It is possible to provide multiple specifications.

This parameter is not relevant when using native screen source.

analysis

full (Full)

automatic (Automatic)

manual (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.

inverse

any (Any)

yes (Yes)

no (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.

grid

   

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

Selecting this parameter creates the grid report.

scope

sentence (Sentence)

contact (Contact)

url (Url)

number (Number)

 

The text scope. Required for devices that support simulated text entry.

Url

Number - Dialing

Sentence - Messages

Contact - Phone book names

Devices that support 'True-Text' do not require this parameter.

caps

Aa (Auto first)

A (Upper case)

a (Lower case)

 

The current capitalization state of typing. Only relevant if the current position is not the first character. Required for devices that support simulated text entry.

imageBounds.needleBound

   

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.

imageBounds.haystackArea

 

786432

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 bounded size.

* Mandatory parameter

Request & Response

Copy

Request

https://mycloud.perfectomobile.com/services/executions/john@perfectomobile.com_controller_16-11-07_19_58_34_522?operation=command&securityToken=<your_token>&command=edit-image&subcommand=set&param.deviceId=6370E775&param.label=PRIVATE:temp%20media\grid-collect-point-icon.png&param.text=Kaplan%20street%2035,%20Petah%20Tikva,%20Israel
Copy

JSON response

{
  "reason": "Success",
  "timer.elapsed": "11782",
  "testGridReportUrl": "https://mycloud.reporting-stg.perfectomobile.com?externalId[0]=john@perfectomobile.com_controller_16-11-07_19_58_34_522",
  "screenAnalysis.analyzedRegion.height": "1920",
  "description": "Success",
  "timer.system": "11782",
  "completed": "true",
  "screenAnalysis.analyzedRegion.left": "0",
  "flowEndCode": "SUCCEEDED",
  "screenAnalysis.analyzedRegion.top": "0",
  "screenAnalysis.resultRegion.left": "85",
  "screenAnalysis.resultRegion.height": "110",
  "screenAnalysis.resultRegion.top": "1400",
  "executionId": "john@perfectomobile.com_controller_16-11-07_19_58_34_522",
  "timer.ux": "0",
  "screenAnalysis.resultPoint.x": "254",
  "singleTestReportUrl": "https://mycloud.perfectomobile.com/nexperience/singletest/report/?reportRepositoryKey=PRIVATE:controller/161107/controller_16-11-07_19_58_34_522.xml&ownerId=john@perfectomobile.com&sharingCode=3eff0387-e7b0-4c0a-af43-419f95dc36ec",
  "screenAnalysis.resultPoint.y": "1455",
  "screenAnalysis.analyzedRegion.width": "1080",
  "screenAnalysis.resultRegion.width": "122",
  "reportKey": "PRIVATE:controller/161107/controller_16-11-07_19_58_34_522.xml",
  "screenAnalysis.grade": "100",
  "timer.device": "0"}