Recovery Object

Description

Enables you to control the recovery scenario mechanism programmatically during the run session. The recovery scenario mechanism enables you to instruct UFT One to recover from unexpected events and errors that occur in your testing environment during a run session.

For more details on the recovery scenario mechanism, see the Micro Focus UFT One User Guide.

Methods and Properties

Method ActivateExplicitly activates the recovery scenario mechanism at a specific point in the run.
Method CountReturns the number of recovery scenarios associated with the current test.
EnabledRetrieves or sets the status of the recovery scenario mechanism for the current test.
GetScenarioNameRetrieves the name and source file of a recovery scenario, according to the specified position in the list of recovery scenarios associated with the test.
GetScenarioPosition

Returns the index position of a recovery scenario in the list of recovery scenarios associated with the test, according to the specified name and source file.

GetScenarioStatus

Returns the status of a recovery scenario (True = enabled or False = disabled), according to the specified index position in the list of recovery scenarios associated with the test.

SetScenarioStatusEnables or disables the specified recovery scenario, according to its index position in the list of recovery scenarios associated with the test.

Back to top

Activate Method

Description

Explicitly activates the recovery scenario mechanism at a specific point in the run.

Note:  

  • The Activate method only works if the recovery mechanism is enabled, and only activates those recovery scenarios that are currently enabled.

    If the recovery mechanism is currently disabled, the Activate method does not activate any recovery scenarios. You can use the Recovery object's Enabled property to change the status of the recovery mechanism.

  • The Activate method works only when the scenario's trigger event is Application Crash and the Recovery Operation is either Keyboard or Mouse operation or Close application process.

Syntax

Recovery.Activate

Back to top

Count Property

Description

Returns the number of recovery scenarios associated with the current test.

Syntax

Recovery.Count

Return Value

Number

Back to top

Enabled Property

Description

Recovery default property. Retrieves or sets the status of the recovery scenario mechanism for the current test.

Syntax

To retrieve the recovery scenario mechanism status:

Recovery.Enabled

or

Recovery

To set the recovery scenario mechanism status:

Recovery.Enabled=Status

or

Recovery=Status

Argument

Type

Description

Status

Boolean

The status of the specified scenario (True = enabled or False = disabled).

Back to top

GetScenarioName Method

Description

Retrieves the name and source file of a recovery scenario, according to the specified position in the list of recovery scenarios associated with the test.

Syntax

Recovery.GetScenarioName Position, out_ScenarioFile, out_ScenarioName

Argument

Type

Description

Position

Number

The index position of the recovery scenario in the list.

Index position values begin with 1.

out_ScenarioFile

String

Variable that stores the retrieved name of the recovery scenario.

out_ScenarioName

String

Variable that stores the retrieved source file path of the recovery scenario.

Back to top

GetScenarioPosition Method

Description

Returns the index position of a recovery scenario in the list of recovery scenarios associated with the test, according to the specified name and source file.

Syntax

Recovery.GetScenarioPosition (ScenarioFile, ScenarioName)

Argument

Type

Description

ScenarioFile

String

The source file path of the recovery scenario.

ScenarioName

String

The name of the recovery scenario.

Return Value

Number

Back to top

GetScenarioStatus Method

Description

Returns the status of a recovery scenario (True = enabled or False = disabled), according to the specified index position in the list of recovery scenarios associated with the test.

Syntax

Recovery.GetScenarioStatus Position

Argument

Type

Description

Position

Number

The index position of the recovery scenario in the list.

Index position values begin with 1.

Return Value

Boolean

Back to top

SetScenarioStatus Method

Description

Enables or disables the specified recovery scenario, according to its index position in the list of recovery scenarios associated with the test.

Syntax

Recovery.SetScenarioStatus Position, Status

Argument

Type

Description

Position

Number

The index position of the recovery scenario in the list.

Index position values begin with 1.

Status

Boolean

The status to set for the specified scenario (True = enabled or False = disabled).

Back to top

See also: