Select text command
Clicks on the text specified by the label parameter.
By default, the select 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.
Parameters
Name | Type | Possible values | Description |
---|---|---|---|
Device ID* |
Device |
The device for this command. |
|
Expected text (needle)* |
Media |
The device for this command. Consider using the entire string searched for, to ensure that if the OCR misses a few characters, the needle will still be found. The text-match algorithm is less error-prone when the provided string is longer. |
|
Search area (haystack) |
String |
all | body |
Defines the screen region where to look for the needle. |
Analysis source |
String |
Primary | Native | Camera | Auto |
The source for retrieving the screen content, where:
|
Target |
String |
As is | Any |
The target search in case the needle includes more than one word, where: As is searches for the entire string content as is, as a complete phrase Any searches for any word in the string. When selecting Any, the words in the Expected text parameter can be divided into phrases with quotation marks. For example: "new contact" "add contact" |
Timeout |
Number |
|
The time, in seconds, to wait for the text to appear. For a dynamic screen, specify the expected waiting time for the text to appear. Example: page load time The timeout contains the system analysis time. For this reason, consider specifying at least 20 seconds. |
Threshold |
Number |
20-100 |
The acceptable match level percentage, between 20 and 100. Values that are too low can lead to a false positive results while values that are too high can lead to a false negative result. |
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.
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'.
This parameter is not relevant when using native screen source. |
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 | Accuracy | Performance |
The text recognition accuracy policy. Selecting the Accuracy value will increase the operation time.
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 image. 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 image. 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 image. 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 image. 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. |
|
Duration |
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. |
|
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. |
|
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. |
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. |
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). |
Match mode |
String |
Same size | Any size | Bounded size |
The needle comparison method.
|
Index |
Number |
|
If the needle has multiple occurrences on the screen, enter the index of the required occurrence. |
Whole-words search |
String |
False | True |
Specifies whether to search for whole words only. |
Ignore case |
String |
False | True |
Specifies if the search pattern should be case sensitive. |
Ignore whitespaces |
String |
False | True |
Specifies whether to ignore spaces within search pattern words. |
Ignore punctuation |
String |
False | True |
Specifies whether to ignore punctuation characters when matching text. |
Exact phrase |
String |
|
Specifies whether to find the exact needle phrase with no errors. |
Touch position direction |
String |
None | Above | Below | Left | Right | Leftmost | Rightmost |
The label position relative to the button (used alongside the Touch position value parameter), where:
Rightmost and Leftmost label position values represent the distance from the screen edge. |
Touch position value |
String |
X and Y values separated by comma |
The value can be in pixels or in percentage of screen height (0-100). For percentage, use the % sign. Example: 20% Used alongside the Touch position direction parameter. If touch position is "none", then label offset is "0". Otherwise, the offset default is 10%. |
Operation |
String |
Single tap | Double tap | Long tap | Trackball roll | No touch |
The touch operation to perform on the found label location. |
Repeat |
Number |
|
The number of times to repeat the operation. Relevant for tap and double tap actions only. |
Report |
String |
Screenshot | Screenshot on error | None |
The value to display in the report.
Consider reducing the resolution in very long scripts that result in large report files. |
Report image resolution |
String |
High | Medium | Low |
The image resolution. Consider reducing the resolution in very long scripts that result in large report files. |
Grid label |
String |
The column name to be used for grid view in the report. Selecting this parameter creates the grid report. |
|
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.
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.
|
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