Working with Character Collections
Character collection searches in Eggplant Functional are a type of image search you can use when optical character recognition (OCR) cannot recognize text written in custom fonts on a system under test (SUT). Unusual backgrounds on the SUT can also make OCR unable to read text—even if it's written in a common font. Character collection searches work by matching text on your SUT with images of characters
that you capture and save in your suite.
Use the information below to create character collections, then use those character collections in your SenseTalk scripts:
Step by Step: Character Collection Capture
Complete the following steps to initiate and complete a Character Collection capture session:
-
Connect to a SUT. When you've connected, the SUT appears in the Viewer window.
-
Start a Character Collection capture session:
- From the main menu, select Control > Start Session > Character Collection Capture Session.
- From the Viewer window, click Start Session > Character Collection Capture Session.
-
In the Viewer window, click each individual character that you want to capture from the SUT screen.
-
After you finish capturing all of the characters, click End Session.
-
Name your session, then press Enter. The session name field is already highlighted for ease of renaming.
-
Highlight the session you just created (or a different one, if you want to generate characters from a different session), then click Open Session.
-
For each character you captured, adjust the characters using the guidelines shown below. Use the following screenshot for guidance. The list of characters collected for this session is located at the bottom of the right pane.
The open session shows a magnified representation of the captured character. If OCR identifies a character at the click point, it sets the capture area around that character and automatically names the captured character. Character images are given names that identify the character they represent. For example, each image is given a name, such as lower_a, upper_A, digit_1, or char_0xAB (for characters other than letters and digits). If the character field is empty, it is labeled as NO CHARACTER. If an image for the specified character already exists in the character collection, or earlier in this capture session, the image name is shown in red (the image name is the string located next to the Character value.
Adjust the captured characters as follows:
-
To adjust the view of the SUT window on the left to offer a better perspective for screen actions, click the Zoom In button to enlarge the screen size or the Zoom Out button to reduce the screen size. Note that this is a view change only; it does not affect your captured characters.
-
To resize the image, drag the edges or corners of the Capture Area, or press Alt + arrow (Option + arrow on Mac) keys. Add the shift key to resize the Capture Area in 10-pixel increments.
ノートWhen resizing the rectangles, keep the rectangles close to the same height. For lowercase letters, do not adjust the rectangle to extend very far below the bottom of the letter.
-
Select the Search Type from the drop-down menu. The default choice for a selected character will generally work well. See The Image Viewer: Searching & Properties for complete information.
-
If the character shown next to Character does not match the view of the SUT window on the left, you can manually change that character. Note that when you change that character, it also changes the string located next to the changed Character value.
-
To move through the list of captured characters, use the arrow keys in the lower left or click the Next or Done buttons.
-
Character images are given names that identify the character they represent. For example, each image is given a name, such as lower_a, upper_A, digit_1, or char_0xAB (for characters other than letters and digits).
-
Select the Skip checkbox if you want to skip and not generate any of the collected characters.
-
-
Click Generate Images, name your character collection, then click Proceed after you decide your characters are named and configured correctly.
ノートIf you need to make corrections before continuing, click Cancel and make further adjustments to your characters.
Eggplant Functional generates a character for each character captured during this Character Collection capture session. The only characters not generated are those characters marked as
skipped
. Eggplant Functional stores these generated images as an image collection using a file name you specify. This image collection resides in the images folder of your suite. You can always add more images to this and other character collections by creating and generating images into a new character collection, then moving images from that new collection into an existing collection. See the Images Pane for more information.
Now the characters from this Character Collection capture session are all available for you as Character Collections in the Images pane of the Suite window. You can use these characters with the ReadCharacters() Function when modifying existing scripts or adding new scripts.
Image Searches Using a Character Collection
To perform an image search using a character collection, use the characters
property, which reads a list of image names from a character collection. The following examples use several SenseTalk commands with the characters
property to complete character collection searches for model number #A1705
.
Example:
click (characters: "#A1705", CharacterCollection: "modelnumber") // Uses the modelnumber character collection to complete the search.