The Eggplant Functional Viewer Window
The Eggplant Functional (EPF) Viewer window opens when you make a connection to a system under test (SUT) through the Eggplant Functional interface. The window shows an image of the remote SUT as you would see it on its own display.
The Viewer window has two modes, Live Mode and Capture Mode. You can interact with the SUT as a user while in Live Mode, and you can capture images to use in Eggplant Functional scripts while in Capture Mode. To toggle between Live Mode and Capture Mode, click the Enter Capture Mode or Enter Live Mode icon in the Viewer window toolbar.
You can also toggle between Live Mode and Capture Mode by pressing Control on Windows or Command on Mac. You can select a different key to perform this action on the Viewer tab of Eggplant Functional Preferences (Eggplant > Preferences > Viewer).
Live Mode

The Viewer window in Live Mode
In Live Mode, you can use your local mouse and keyboard to interact with the SUT as a user. This interaction works as if you were using the SUT's own keyboard and mouse directly. In Live Mode, you can also copy and paste text between applications running on the SUT and your local computer.
You can use this functionality to navigate in the remote SUT, launch applications, and otherwise prepare the environment to capture images and perform the tests you're interested in.
If the Viewer window is not your local system's active window, your clicks and keystrokes are applied to your local computer, not the SUT.
Capture Mode

The Viewer window in Capture Mode
In Capture Mode, you can capture images from your SUT, combined with commands and functions that represent the actions you want to perform, then insert the resulting SenseTalk code into your current script. The Viewer window is dimmed in Capture Mode, except for the Capture Area, described below.
Capturing Images
To capture an image from the SUT, click the image. The Eggplant Functional edge detection functionality automatically sizes the Capture Area around the image for you. In most cases, the auto-sized image should work fine for SenseTalk scripting and image searches. However, you can adjust the size and placement of the Capture Area manually as well; see The Capture Area below for details.
When you capture an image based on automatic edge detection, the hot spot is placed where you clicked, which is not necessarily in the center of the image. You can move the hot spot as required. See The Hot Spot for complete information about the hot spot.
If you want to add the image to the suite without inserting code into a script, click Capture Image on the Viewer window toolbar, or right-click in the Capture Area and select Add Image.
To capture the image to the suite along with adding an associated line of code to your current script, click the appropriate button on the toolbar (e.g., Click, DoubleClick), or right-click in the Capture Area and select the appropriate action from the drop-down menu. The Viewer window provides many code options you can include with your captured images. This functionality is the basis for the assisted scripting method of script generation in Eggplant Functional.
When you have selected the method to capture the image, the Image Capture panel opens. This panel is basically a Save dialog box, but it provides additional opportunities for updating the options you want to use with the image in your scripts. See The Image Capture Panel for complete information.
For more information about image capture, see Image Capture Best Practices.
The Capture Area
The Capture Area in Eggplant Functional
In Capture Mode, the Capture Area shows the area that is included when you save an image. It is the rectangle shown at normal brightness when the rest of the Viewer window is dimmed. By default, Eggplant Functional uses edge detection to automatically size the Capture Area for images you click. When you click anywhere in the Viewer window while in Capture Mode, the Capture Area moves to that location and automatically sizes around what it detects as the image you clicked.
If you click an area of the screen where there is no image, or Eggplant Functional can't detect the edges of an image, the Capture Area still moves to that location and the size is set to the default, 64 X 64 pixels. You can use Shift+click to move the Capture Area to an image without using edge detection; the Capture Area moves to the new location without changing size so that you can manually adjust the edges as you wish.
To move the Capture Area, you can click and drag it to a new location. You can also nudge the Capture Area one pixel at a time by pressing the arrow keys. Use Shift+arrow to move the Capture Area in ten-pixel increments.
To resize the Capture Area, drag the edges. You can also nudge the size one pixel at a time with Alt+arrow (Option+arrow on Mac) keys. Add the Shift key to resize in ten-pixel increments.
The Capture Area includes a drop-down arrow at the upper-right. Clicking the button opens the context menu, which lets you select a command to include with the captured image to insert into your active SenseTalk script. Note that this is the same menu you see if you right-click within the Capture Area. Choose Add Image if you want to capture an image without adding SenseTalk code.
The Capture Area is drawn with a gray border to make it easier to see on dark backgrounds. You can turn this border off in Viewer window preferences.
The OCR Tuner
Adjust optical character recognition (OCR) search properties with the OCR Tuner. Open the OCR Tuner from the drop-down arrow located in the upper right corner of the Capture Area.

Launching the OCR Tuner in Eggplant Functional
You can also adjust these properties from the OCR Update Panel and from Text Preferences. See Using the OCR Tuner for more information.
The Hot Spot
The Capture Area with the hot spot highlighted
The hot spot is the red crosshairs that you see inside the Capture Area. The hot spot is the point that is clicked when a script executes a Click or other command action on an image. The red crosshairs automatically turn black when the Capture Area is positioned over a predominantly red image.
To move the hot spot in a Capture Area, Ctrl+click or Ctrl+drag the crosshairs (Cmd+click or Cmd+drag on Mac). You can also nudge the hot spot in one-pixel increments with Ctrl+arrow (Cmd+arrow on Mac). Adding the Shift key moves the hot spot in ten-pixel increments.
You can position the hot spot outside of the Capture Area. This can be useful when you need a click or other action to happen at a location that doesn't include an easily recognizable image, such as within a text field. You can capture an image that will be found in the same location relative to the spot where you want the action to take place, then move the hot spot the location where you want the action to occur.
Full-Screen Control
With full-screen control, you can view the SUT as your entire desktop. A small control panel provides access to the regular Viewer window features. To open the control panel, choose Control > Control Panel from the main menu.
To customize the buttons displayed on the control panel, right-click in the panel, and choose Viewer window items from the context menu.
To enter full screen view, click the Enter Full Screen button, or use the keyboard shortcut Ctrl+Alt+Enter (Option+Cmd+Return on Mac). To return to your own desktop, click the Exit Full Screen button, or type the same keyboard shortcut you used to enter full screen view.

The Full-Screen Control Panel
Zooming
It is possible to zoom in on the SUT while in capture mode. The Viewer window must be set to show the SUT at full scale. To zoom in on Windows or Linux, hold Control and press the plus (+) key. To zoom out, hold Control and press the minus (-) key. On Mac, use the Command key instead of Control.
The Viewer Window Toolbar

The Viewer window toolbar
Most of the buttons in the Viewer window toolbar are also represented as menu items in the Control menu.
The toolbar buttons are described below. Because the toolbar can be customized, you might not see all the same buttons on your own toolbar. For information about adding and removing toolbar buttons, see Customize below.
Note that if you add buttons to the toolbar, or if you shrink the size of the Viewer window, you might see the overflow chevron (double arrow) at the right side of the toolbar. Click the chevron to open a menu with the additional options.

A double chevron in the Viewer window toolbar indicates additional items that won't fit on the window
The Default Toolbar Buttons
The following list describes the default set of buttons that appear on the Viewer window toolbar. See the Customize section to learn how to change and rearrange the buttons in the toolbar.
Enter Capture Mode /
Enter Live Mode
This button toggles the Viewer window between Live Mode and Capture Mode. When you click Enter Capture Mode, it switches the Viewer windows to Capture Mode and the button changes to Enter Live Mode. When you click Enter Live Mode, it switches the Viewer windows to Live Mode and the button changes to Enter Capture Mode.
You can also toggle between Live Mode and Capture Mode quickly by pressing Control on Windows or Command on Mac. You can select a different key to perform this action in the Viewer Window Preferences.
Start Session /
End Session
This button starts and ends Rapid Image Capture, Turbo Capture, Autoscan, and Character Collection capture sessions. It toggles between Start Session and End Session according to whether a session is in progress.
Scale to Fit /
Show Full Size
This button toggles between showing the Viewer window at the SUT's full display size and showing the entire SUT scaled to fit the size of the Viewer window. Switching between the sizing options has no effect on the functionality of the Viewer window, image captures, or image matching.
Capture Image
The Capture Image button captures an image of the area currently selected by the Capture Area and opens the Image Capture panel, which is described in detail below.
Find Text
The Find Text button opens the Find Text panel, where you can search for text without using a previously captured image. The Find Text panel is described in detail below. The Find Text button is available in both Capture Mode and Live Mode.
Shift-clicking a command button also opens the Find Text panel.
Set Rectangle
This button opens the Set Rectangle and Generate Code dialog box, which helps you easily set search rectangles and perform related actions on the SUT. This dialog box is described in detail below.
Click,
DoubleClick,
MoveTo
These command buttons perform three actions at once:
- Save an image of the SUT as selected by the Capture Area into the Images folder of the current suite.
- Insert the respective SenseTalk command (Click, DoubleClick, or MoveTo) into the active script.
- Perform the respective action on the SUT.
WaitFor
The WaitFor command causes a script to pause and wait for an image to appear in the Viewer window.
When you click the WaitFor button, an image capture panel opens. In the Maximum Wait text field, enter the longest period of time (in seconds) that you want the script to wait for the image to appear in the Viewer window.
When you run the script, the script executes the next command as soon as the WaitFor image appears. If the image does not appear in the maximum wait time, the test fails.
TypeText
The TypeText command sends text as keystrokes typed in the Viewer window, allowing you to simulate typing on the SUT.
The TypeText button opens a panel in which you can enter your text parameters. When you create a TypeText command with this panel, clicking the Insert button automatically encloses your text parameters in quotation marks in your script.
Text parameters enclosed in quotation marks are typed as literal text on the SUT. Text parameters that are not enclosed in quotation marks are treated as variables.
When the Viewer window is in capture mode, you can start a TypeText command by typing the text you want to insert into your script. For more information, see Typing on the SUT.
Home
The Home button presses the home button on mobile devices.
Press
The Press button executes a tap and hold on mobile devices.
Customize the Toolbar
To customize the Viewer window toolbar, go to Window > Customize Toolbar. A panel opens in which you can select the buttons that are available in the Viewer window toolbar. You can also right-click in the toolbar itself to open the Customize panel.

The Customize Toolbar panel
To add a button to the toolbar, drag the button from the Customize Toolbar panel to the toolbar. To remove a button from the toolbar, drag it off of the toolbar. While the Customize Toolbar panel is open, you can also rearrange the buttons within the toolbar.
Default Buttons
To return to the default set of buttons, open the Customize panel. On Mac, drag the default button set to the toolbar. On Windows, click Reset.
Vertical Toolbar
The toolbar can also be displayed vertically. To do this, go to Window > Show Vertical Toolbar. To switch to a horizontal toolbar, go to Window > Show Toolbar.
The Image Capture Panel
The Image Capture panel in Eggplant Functional is similar to a Save dialog box, with some additional script and image controls.

Image Capture panel in Eggplant Functional
Image Name: The Image Name field defaults to a dynamically generated name that is unique to the current suite, beginning with image0001. This name might be sufficient for temporary scripts and experimentation, but more descriptive names are easier to follow as you start scripting in earnest.
Image names can contain alphanumeric characters, spaces, and most punctuation marks.
OCR Button: When you click the eyeball button, OCR suggests a name for the new image based on any characters it detects in the image.
Where: This drop-down list displays the folders in which you can save an image. The default choice is the Images folder of the current suite.
Tags: Apply existing Image Tags to the new image. You can also create new tags in this field.
Use Existing: If Eggplant Functional detects similarities between a new image and an image already in the suite that's open, it suggests that you use the existing image rather than save a new one.
Image Well: The central portion of the Capture panel that displays the captured image. The hot spot in the image is indicated by red crosshairs. To move the hot spot, Ctrl+click in the image (Cmd+click on Mac) or Ctrl+drag the crosshairs (Cmd+drag on Mac).
If the captured image is too large for the image well, it is scaled down to fit. The actual image is not affected, but it might appear distorted in the Capture panel.
Search Type: The Search Type drop-down list lets you choose a search type other than the default at the time of image capture.
The default choice in the Search Type drop-down list depends on the image you are saving. Eggplant Functional attempts to choose the most appropriate search type for each image. Tolerant to Background is the most common default search type.
You can adjust the default value of the Precise Image Tolerance, Standard Image Tolerance, and Adaptive Image Tolerance in the Screen tab of Run Preferences.
Command/Function: To insert a command or function into the script with your image, choose the command or function in the Command/Function drop-down list. To insert the image into the script with no command or function, choose Capture Image. To insert the image into a selected command or function in the script, choose Add Image.
Max Wait: Specify the maximum wait time associated with the Wait or WaitFor commands (in seconds) in this field.
Suite Location: Choose the suite you want to save the new image into from this drop-down list. Note that a suite must be open to display in this menu.
New Folder: To create a subfolder within the currently selected folder, click the New Folder button.
Make Collection: To make an Image Collection based upon an existing image, select the image and click the Make Collection button. The Image Collection takes on the same name as the image, and the image is automatically moved into the Image Collection. To learn more about this feature, see Creating an Image Collection.
Cancel: To cancel the image capture and close the Capture panel, click the Cancel button.
Save: To complete the image capture and close the Capture panel, click the Save button.
The Use Image Panel (Mac and Linux only)
The Use Image panel in Eggplant Functional is similar to a standard Open dialog, with added script controls at the bottom. The Use Image button can be added when you customize the Viewer window toolbar.

Use Image panel in Eggplant Functional
File Browser: Use this to navigate between the current suite’s Images directory and subfolders.
Command/Function: Choose a command or function to enter into the script with your image from this drop-down list. To incorporate the image into the selected command or function in the script, choose Add Image.
Max Wait: Specify the maximum wait time associated with the Wait or WaitFor commands (in seconds) in this field.
Options: Shows or hides the Command/Function list and Max Wait field.
Cancel: Cancels the image selection and closes the Use Image panel.
Insert: Inserts the generated command or function into the script, executes the command (if possible), and closes the Use Image panel.