Options Object

Applies to TestComplete 14.71, last modified on April 22, 2021

In your tests, you can use the Options objects to get access to:

  • Some of the properties of your current TestComplete project.

  • Internet Explorer settings.

  • Script extension options specified in the extension’s description.xml file. Use the object to access options of the script extension’s source code. For more information on this, see the Option topic.

The Code Completion window of the Code Editor displays the list of properties (options) available for the Options object.

These properties are organized into the following groups:

FlashSettings

The FlashSettings group provides access to the Flash player settings that you may need to configure before testing Flash and Flex applications with the debug version of Flash Player. For information about the available settings, see FlashSettings Object.

IESettings

The IESettings group provides access to Internet Explorer settings that are displayed on the Advanced page of Internet Explorer’s Tools | Options dialog. For more information about available settings, see IESettings Object.

IEZoneSettings

The IEZoneSettings property of the Options object returns the IEZoneSettingsManager object that is used to provide a scripting interface to settings of Internet Explorer security zones. See the object description.

Images

This group provides access to image settings. These settings effect the format of images that are saved into the Stores | Regions collection (such as image checkpoints) or posted to the test log.

The Images property is obsolete. To specify the image format in which images will be posted to test log, configure your project properties.
Property Description
GIFColorReduction The Color reduction option, which is available if Image format is set to GIF Format. String. Read/write. Possible values are:
  • Windows system (20 colors)
  • Windows halftone (256 colors)
  • Windows grayscale (4 colors)
  • Monochrome (black/white)
  • Grayscale (256 shades)
  • Netscape (216 colors)
  • Optimized (8 colors)
  • Optimized (16 colors)
  • Optimized (32 colors)
  • Optimized (64 colors)
  • Optimized (128 colors)
  • Optimized (256 colors)
  • Optimized Windows (256 colors)
GIFDitherMode The Dither mode option, which is available if Image format is set to GIF Format. String. Read/write. Possible values are:
  • Nearest color
  • Floyd Steinberg
  • Stucki
  • Sierra
  • Jarvis, Judice & Ninke
  • Stevenson & Arche
  • Burkes
ImageFormat The Image format option. Specifies the format that is used to post images to the test log. String. Read/write. Possible values are “BMP”, “JPEG”, “PNG”, “TIFF”, “ICO” or “GIF”.
ImageColorPalette The Image color palette option, which is available if Image format is set to BMP Format. String. Read/write. Possible values are:
  • Native (no transformation)
  • 16 Colors
  • 256 Colors
  • 65536 Colors
  • 16777216 Colors
  • True Color
JPEGImageOutput Specifies whether the JPEG images posted to the log are color or grayscale. String. Read/write. Possible values are “Color” and “255 shades of gray”.
JPEGPixelFormat String. Read/write. Possible values are “8-bit” (if the Gray Scale check box is selected) and “24-bit” (if Gray Scale is unselected).
JPEGQuality The Compression quality option, which is available if Image format is set to JPEG Format. Integer. Read/write. Possible values are 1 … 100.

JavaOpenApps

The JavaOpenApps group is available only if the Java Application Support support is enabled in TestComplete. It provides access to the Open Applications > Java project properties.

Property Description
DoNotRecognizeChildSWTAsParent Provides a scripting interface to the “Do not recognize child windows of an SWT control as the same SWT control” setting.
Boolean. Read/write.

OpenApps

The OpenApps group provides access to one of the Open Applications > General project properties.

Property Description
InvokeTimeout Provides a scripting interface to the “Method invoke timeout” setting.
Integer. Read/Write.

Packer

This group provides access to one of the options displayed in the Packer Options dialog.

Property Description
CmdLine Command line option. String. Read-Only. Note that the file path must be enclosed in double quotes and separated from the first command-line parameter by at least one space. For instance, "C:\Archivers\Arj.exe" a -+ -r -y -a1 -p -- %%a !%%LM".

Project

The Project group provides access to project options:

Property Description
General Provides a scripting interface to the General group project options. Currently, the object has only one property:
  • TreeModel - Provides access to the project’s Object tree model option. String. Read-Only. Possible values are “Tree” and “Flat”.
TreeModel Same as General.TreeModel (see the paragraph above).
Note: This property is left for backward compatibility only. It is recommended that you use the General.TreeModel property.

Run

This group provides access to the Playback project properties.

Property Description
CaseSensitive Use case-sensitive parameters option. Boolean. Read-only.
ClickOnButton Click on focused control option in the On Unexpected Window group. Boolean. Read-only.
Delay Delay between events option. Integer. Read/write.
ErrorDialog Show a notification when an unhandled script exception occurs option. Boolean. Read-only.
IgnoreOverWindow Ignore overlapping window option in the On Overlapping Window group. Boolean. Read-only.
ObjectSearchStrategy Object search strategy option. String. Read-write. Possible values:
  • searchDepthFirst – "Depth-first"

  • searchBreadthFirst – "Breadth-first"

You can use both constants and their string values:

JavaScript, JScript

Options.Run.ObjectSearchStrategy = searchDepthFirst; // or Consts.searchDepthFirst
Options.Run.ObjectSearchStrategy = "Depth-first";

Python

Options.Run.ObjectSearchStrategy = searchDepthFirst # or Consts.searchDepthFirst
Options.Run.ObjectSearchStrategy = "Depth-first"

VBScript

Options.Run.ObjectSearchStrategy = searchDepthFirst ' or Consts.searchDepthFirst
Options.Run.ObjectSearchStrategy = "Depth-first"

DelphiScript

Options.Run.ObjectSearchStrategy := searchDepthFirst; // or Consts.searchDepthFirst
Options.Run.ObjectSearchStrategy := 'Depth-first';

C++Script, C#Script

Options["Run"]["ObjectSearchStrategy"] = searchDepthFirst; // or Consts["searchDepthFirst"]
Options["Run"]["ObjectSearchStrategy"] = "Depth-first";

PressEnter Press Enter option in the On Unexpected Window group. Boolean. Read-only.
PressEsc Press Esc option in the On Unexpected Window group. Boolean. Read-only.
SendWMClose Send the close command option in the On Unexpected Window group. Boolean. Read-only.
StopOnUnexpWindow Stop execution option in the On Unexpected Window group. Boolean. Read-only.
StopOnError This property is obsolete. It is supported for backward compatibility only.
Error handling > On error project property. Boolean. Read-only. If the project property is set to Continue running, returns false. Otherwise, returns true.
StopOnRecognitionError This property is obsolete. It is supported for backward compatibility only.
Error handling > On object recognition error project property. Boolean. Read-only. If the project property is set to Continue running, returns false. Otherwise, returns true.
StopOnWarning This property is obsolete. It is supported for backward compatibility only.
Error handling > On warning project property. Boolean. Read-only. If the project property is set to Continue running, returns false. Otherwise, returns true.
Timeout Auto-wait timeout option. Integer. Read/write.

Visualizer

This group provides access to the Visualizer project properties.

Property Description
CollectMode Collect Test Visualizer data during test run option. String. Read/write. Possible values are:
  • vcmOff - “Off”
  • vcmImg - “Capture images only”
  • vcmImgObj - “Capture images and test object info”
As for the vcmOff constant, you can use either the constant or its string value (Off). For the rest of the constants, use the constant names only.

JavaScript, JScript

// Set the option to "Off"
Options.Visualizer.CollectMode = "Off";
// Set the option to "Capture images"
Options.Visualizer.CollectMode = vcmImg;

Python

# Set the option to "Off"
Options.Visualizer.CollectMode = "Off"
# Set the option to "Capture images"
Options.Visualizer.CollectMode = vcmImg

VBScript

' Set the option to "Off"
Options.Visualizer.CollectMode = "Off"
' Set the option to "Capture images"
Options.Visualizer.CollectMode = vcmImg

DelphiScript

// Set the option to "Off"
Options.Visualizer.CollectMode := 'Off';
// Set the option to "Capture images"
Options.Visualizer.CollectMode := vcmImg;

C++Script, C#Script

// Set the option to "Off"
Options["Visualizer"]["CollectMode"] = "Off";
// Set the option to "Capture images"
Options["Visualizer"]["CollectMode"] = vcmImg;

Web

The Web group is available only if the Web Testing is enabled in TestComplete. It provides access to the Open Applications > Web Testing project properties.

Property Description
CSSTransitionForPagePicture Specifies whether the Page.PagePicture method uses CSS transition when scrolling a web page. Boolean. Default value is True.

Use the option to specify how “sticky” elements (elements with a fixed position) should appear in the visible area of the page while the PagePicture method is scrolling the page. To learn more, see the Remarks section in the PagePicture method description.

Known Issue: The CSS transition may not work on pages opened in Internet Explorer or applications that use Chromium Embedded Framework versions prior to 3.2171. For such pages, elements with fixed positions may remain in the visible area of the page when scrolling, and the captured image will have those elements repeated.

The PagePicture method in TestComplete versions prior to version 12.31 does not use CSS transition. If in your tests created in previous TestComplete versions you have images captured by the PagePicture method, those images might differ from images captured in TestComplete version 12.31 and later. If you use those images for image comparison or region checkpoints, your tests may fail. We recommend that you update your baseline images or disable CSS transition for the PagePicture method in your project.
IdentificationAttribute Identification attribute option. String. Read/write. Possible values are “ID” and “Name”.
TreeModel Tree model option. String. Read/write. Possible values are “Tree”, “DOM”, “Tag”, and “Hybrid”.

All the models except for the Tree model are obsolete. They are supported for the backward compatibility only. We do not recommend that you use them in your tests.

JavaScript, JScript

Options.Web.TreeModel = "Tree"; // Set the Tree model

Python

Options.Web.TreeModel = "Tree" # Set the Tree model

VBScript

Options.Web.TreeModel = "Tree" ' Set the Tree model

DelphiScript

Options.Web.TreeModel := 'Tree'; // Set the Tree model

C++Script, C#Script

Options["Web"]["TreeModel"] = "Tree"; // Set the Tree model

WebPageLoadingTimeout Web page loading timeout option. Integer. Read/write.

See Also

TestComplete Options
Project Properties
TestComplete Helper Objects

Highlight search results