Recovery Object in UFT

Recovery object is used to manage the recovery scenarios associated with the test.
  • .qrs is the extension of the recovery scenario file.
  • We can associate multiple .qrs files to UFT test.
  • Each .qrs file can have one or more recovery scenarios.
  • Using Recovery object, you can associate .qrs files with test and also enable or disable specific scenarios during the test run.
 
msgbox "Is recovery mechanism enabled in the UFT test -> " & Recovery.Enabled

msgbox "Number of Recovery Scenarios in current UFT test -> " &  Recovery.Count

for i = 1 to Recovery.Count 
    'get scenario name and file 
    Recovery.GetScenarioName i, ScenarioFile, ScenarioName 
    
    'Get scenario position
    Position = Recovery.GetScenarioPosition(ScenarioFile, ScenarioName) 
    msgbox "Scenario name at position " & i & " is " & ScenarioName & " and it is in file " & ScenarioFile
    
    'Check if the scenario is enabled
    msgbox "Scenario at position " & i & " is enabled? ----> "  & Recovery.GetScenarioStatus(Position) 
Next 

'disable first scenario
Recovery.SetScenarioStatus 1, False

Complex problems, Simple Solutions