Eggplant Functional Global Properties
The Eggplant Functional global properties pertain to running SenseTalk scripts from the Eggplant Functional application specifically. However, keep in mind that the general SenseTalk global and local properties are also useful in Eggplant Functional scripting. (For example, The ColorFormat global property.)
In addition to the application-specific properties described below, SenseTalk also includes Run Options global properties for Eggplant Functional that pertain to interactions with a system under test (SUT) in the course of a test run.
Many of these global properties appear in the Text and Run preferences in Eggplant Functional (Eggplant > Preferences). Using them as global properties lets you change them on a script-by-script basis, or even multiple times within a single script. Changing the value of a property within a script affects that value for that runtime, but does not change the value set in the application preferences.
For general information about using local and global properties, see Local and Global Properties in SenseTalk.
The CaptureScreenImageFormat Global Property
Values: PNG, JPG, or TIFF
Default: PNG
Behavior: Modifies the image file format used by the CaptureScreen command when capturing screenshots during a test run.
Example:
set the CaptureScreenImageFormat to JPG
The CaptureScreenJPGCompressionQuality Global Property
Values: Integer between 1-100
Default: 100 (no compression; as lossless as possible)
Behavior: Adjusts the compression quality of JPG formatted screenshots captured by the CaptureScreen command. The number indicates the percentage of image quality that is preserved during image compression; 1 being a much lower quality image with a higher amount of image data loss, and 100 meaning that the compression preserves as close to 100% of original quality as possible.
Example:
set the CaptureScreenJPGCompressionQuality to 75 -- Reduces the compression quality, making the file even smaller, but sacrificing some image clarity
The CaptureScreenScaleFactor Global Property
Values: Decimal value between 0 and 1.
Default: 1 (full size)
Behavior: Scales images captured by the CaptureScreen command proportionally. Setting the ScaleFactorForCaptureScreen to .5, for instance, will cut the image dimensions (both height and width) of the screenshot captured in half, before it is saved. So, a 1000x1000 pixel image will be cut to 500x500 px.
This functionality is specific to images captured by the CaptureScreen command, and is different from the Scale Factor used with image searching. For more on how to scale captured images for search purposes, see Image Scaling on the Finding Images page, or The ScaleFactors Global Property.
Example:
set the CaptureScreenScaleFactor to .5 -- This will cut the scale of the image in half
The CollectionFilter Global Property
Values: A property list that contains one or both of the properties Name and Description
Default: No filter
Behavior: Limits image searches to those images whose names or descriptions contain the specified string.
To set a description for an image, use the image viewer in the suite.
Example:
Set the CollectionFilter to (Name: "English", Description: "release 5.0")
Example:
params SUTOS
If SUTOS is "iOS"
set the CollectionFilter to (Name:"iOS")
else if SUTOS is "Android"
set the CollectionFilter to (Name:"Android")
end if
To reset the CollectionFilter, set the value to empty.
Example:
Set the CollectionFilter to empty
The CommandLineOutput Global Property
Values: True (or On, or Yes), False (or Off, or No)
Default: False
Behavior: The CommandLineOutput controls the output of messages to the standard output stream when a script is run from the Unix or Windows command line:
- Off: No output is sent to standard output (stdout).
- On: All of the script output that would appear in the Eggplant Functional graphical interface is sent to the standard output stream.
Example:
Set the CommandLineOutput to On
Example:
SetOption CommandLineOutput, Off
The CommandLineOutput is also available as a runscript command line option.
The CompareScreenAction Global Property
Values: ShowPanel, LogWarning, LogError, or ShowPanelAlways
Abbreviated terms that distinguish between the settings are also allowed: Panel, Warning, Error, or Always
Default: ShowPanel
Behavior: This global property controls the action performed when you run a CompareScreen command. You can use this property to change the behavior within a script run. The available options are:
ShowPanel: If a screen difference is detected, the Compare Screen panel opens.LogWarning: If a screen difference is detected, a warning message is entered in the log.LogError: If a screen difference is detected, an error message is entered in the log.ShowPanelAlways: The Compare Screen panel opens regardless of whether any screen difference is detected.
Example:
set the CompareScreenAction to "Always"
Example:
BeginTestCase "Detect Full Screen Differences"
// Set the compare screen global property to not show the panel and log a warning
set the CompareScreenAction to "LogWarning"
Log "Verify the rectangle captured is found as expected before changing it"
click "Contacts" -- To set the tutorialSut back to its default screen
CompareScreen Name:"tutorialSutMenus"
Log "Now let's change the tutorial Sut screen"
Click "Favorites"
Log "...and run CompareScreen again"
CompareScreen Name:"tutorialSutMenus"
EndTestCase "Detect Full Screen Differences"
Related:
The CurrentCharacterCollection Global Property
Values: Empty, or the name of a character collection
Default: Empty
Behavior: This property lets you set a default character collection for image searches that use the character property (i.e., searches intended for a character collection). When you set a value for the currentCharacterCollection, you can omit the characterCollection property from character searches. You can also omit the characterCollection property from a readCharacters function call. Supplying the name of the character collection toreadCharacters or with a characterCollection property overrides the value of the currentCharacterCollection global property.
Example:
set the currentCharacterCollection to "iPhoneCharacters"
Related:
- [ReadCharacters](stk-ocr-text-reading-functions.md#readchar)
- Working with Character Collections
The DefaultCaptureScreenSize Global Property
Values: A list of values representing the width and height of the SUT at time of image capture. Given as (width,height).
Default: Empty
Behavior: The DefaultCaptureScreenSize sets the default screen size of the SUT at time of image capture for any images captured prior to Eggplant Functional v12.20. This is for use with Dynamic Scaling in image searches. For more information see Dynamic Scaling.
Example:
set the DefaultCaptureScreenSize to (1024,768)
The DefaultUseMarkup Global Property
Values: True (or On, or Yes), False (or Off, or No)
Default: False
Behavior: The DefaultUseMarkup determines whether or not supported text markups are recognized in the Text property of a text property list. When the DefaultUseMarkup is set to yes, supported markups are used to format generated text images. When the DefaultUseMarkup is set to no, markups are treated as literal text. (Markups are always treated as literal text for text platforms that use the OCR text engine.)
Example:
set the defaultUseMarkup to No
Example:
setoption DefaultUseMarkup, Yes
The FinalSuites Global Property
Values: One or more suite names
Default: None
Behavior: The FinalSuites global property determines the suite or suites that are searched for script or image resources after the script's own suite is searched. (Suites named in the InitialSuites are searched first, followed by the script's own suite, and then the FinalSuites.)
Example:
Set the FinalSuites to ("FallBack") //Sets the FinalSuites to a suite named "FallBack"