Setting Object

Description

Enables you to modify test settings during the test run. The settings are a dictionary of keys and their values, to be used as global variables.

Syntax

To retrieve the setting:

Value = Setting("KeyName")

To set the setting:

Setting("KeyName") = Value

The table below describes the available keys for the Setting object.

KeyName

Value Type

Possible Values/Description

AutomaticLinkRun

Variant

True: Automatic checkpoints are executed.

False: Automatic checkpoints are not executed.

DefaultLoadTime

Number

The time to add, in seconds, to the load time during recording. This option is a safeguard that prevents the test from failing in the event that the amount of time it takes for a page to load during the run session is higher than the amount of time it took during the record session.

DefaultTimeout

Number

Maximum time in milliseconds to wait before it is determined that an object cannot be found.

SnapshotReportMode

Number

Indicates when the images are captured. The value can be one of the following:

0 - always captures images.

1 - captures images only if an error occurs on the page.

2 - captures images if an error or warning occurs on the page.

3 - never captures images.

Default = 1.

WebTimeout

Number

Maximum time in milliseconds to wait before it is determined that a URL address cannot be found.

Note: In addition to the Setting keys described above, additional keys are available for the Setting.WebPackage property (see WebPackage Property) and the Setting.Java property (see the Java section of the UFT One Object Model Reference for GUI Testing).

Methods and Properties

Method AddChecks that an object exists.
Method ExistsDetermines if a key exists in the dictionary.
ItemSets or retrieves the value of a given key from the dictionary.
Remove

Removes a user-defined run-time setting.

WebPackageEnables you to set or retrieve the value of keys defined for the Web Add-in.

Back to top

Add Method

Description

Adds and sets a user-defined run-time setting.

Syntax

Setting.AddSettingName, SettingValue

Argument

Type

Description

SettingName

String

Assigns a name to the new run-time setting.

SettingValue

String

Assigns a value to the new run-time setting.

Back to top

Exists Method

Description

Determines if a key exists in the dictionary.

Syntax

Setting.Exists(Key)

Argument

Type

Description

Key

String

The name of the key to check.

Back to top

Item Property

Description

Sets or retrieves the value of a given key from the dictionary.

Syntax

Setting.Item(Key)

Value Name

Type

Description

Key

String

The name of the object's key.

Back to top

Remove Method

Description

Removes a user-defined run-time setting.

Syntax

Setting.RemoveSettingName

Argument

Type

Description

SettingName

String

The name of the run-time setting.

Back to top

WebPackage Property

Description

Enables you to set or retrieve the value of keys defined for the Web Add-in.

The table below describes the available keys for the WebPackage property.

KeyName

Value Type

Possible Values/Description

ReplayType

Number

Indicates how mouse operations should be run. The value can be one of the following:

1 - Runs mouse operations using browser events.

2 - Runs mouse operations using the mouse.

Example: Usage:

Setting.WebPackage("ReplayType") = 2

ReplayUsingSourceIndex

Number

Indicates whether the source index property should be used. The value can be one of the following:

0 - Does not use the source index property to identify objects.

1 - Uses the source index property to identify objects

Example: Usage:

Setting.Packages.WebPackage.Settings("ReplayUsingSourceIndex") = 0
EnableWebRoleBasedKitNumber

Indicates whether to use the Web Accessibility role-based toolkit for object identification of Web object. The value can be one of the following:

0 - Does not use the toolkit

1 - Uses the toolkit

Example: Usage:

Setting.Packages.WebPackage.Settings("EnableWebRoleBasedKit") = 1

Back to top

See also: