Tricentis Tosca 16.0 Released on Feb-2023 ----- UFT has been upgraded from UFT 15.0.1 to UFT One 15.0.2, Beginning at November 2020.

Tuesday 30 April 2019

What is SAP R/1, R/2 and R/3 .. ? Difference between R/1, R/2 and R/3 ... ?

SAP R/1

SAP R/1 was the first version and it is one tier architecture in which three  layers  Presentation, Application and Data base are installed in one system/server'

Server one- Presentation+Application+Database

SAP R/2

SAP R/2 is the mainframe version of software and it is 2  tier architecture

Thursday 25 April 2019

Fetching Test Data from Excel Sheet and Setting into Application Fields.

Option Explicit
Dim Sheetpath, FsoObject, Excelsheet, rowNumber, UserId,Pwd, SheetCells, Row_Count, i
Sheetpath="D:\testdata.xlsx"
Set FsoObject=CreateObject("Excel.Application")
FsoObject.Workbooks.Open Sheetpath
Set Excelsheet=FsoObject.ActiveWorkbook.Worksheets("Sheet1")
Row_Count=FsoObject.ActiveSheet.UsedRange.Rows.Count
For i=1 to Row_Count
   UserId=FsoObject.Cells(i,1).value
   Pwd =FsoObject.Cells(i,2).value

   Browser("...").Page("...").WebEdit("UserId").Set UserId
   Browser("...").Page("...").WebEdit("Password").Set Pwd
   Browser("...").Page("...").WebButton("Login").Click
   LoginText=Browser("...").Page("...").WebEdit("text").GetROProperty("text")
   Excelsheet.Cells(i,3)=LoginText
Loop
FsoObject.ActiveWorkbook.Save
FsoObject.Application.Quit
Set FsoObject=nothing

Fetching Test Data from DataBase  and Setting into Application Fields.

Option Explicit
Dim path, app, Sheets, row, UserId, Pwd
Set app=CreateObject("ADODB.Connection")
Set rec=CreateObject("ADODB.Recordset")
app.Open "Provider=SQLQLEDB;Server=.\SQLEXPRESS;UserId=test;Password=P@123;Database =AUTODB"
rec.LockType=3
rec.Open "Select * from LoginData",app

Do while rec.EOF<> True
   UserId=rec.Fields.Item("UserName")
   Pwd=rec.Fields.Item("PassWord")
   Browser("...").Page("...").WebEdit("UserId").Set UserId
   Browser("...").Page("...").WebEdit("Password").Set Pwd
   Browser("...").Page("...").WebButton("Login").Click
   LoginText=Browser("...").Page("...").WebEdit("text").GetROProperty ("text")
   rec.Fields.Item("StatusMessage").Value=LoginText
   rec.Update
   rec.MoveNext
Loop

app.Close
rec.Close
Set app=
Nothing
Set rec=Nothing

Tuesday 23 April 2019

UFT 14.52 Released: 6 New Features 



Micro Focus released UFT-14.52 in the last week of March 2019.  Here is the complete list of new features, integrations and enhanced support for various technologies and browser versions.

1. New PDF Addin

Micro Focus has introduced official support for PDF documents. We can now test PDF documents, using the newly launched PDF add-in (in tech preview mode),  which can be installed like the regular UFT add-ins. Make sure to install and then enable it from the UFT Add-in Manager.
PDF addin under Addin-manager

2. Mobile testing comes to local devices in UFT 14.52


With the launch of UFT 14.52, mobile testing is now available on local devices connected to a UFT machine. You would just need to install the UFT mobile add-infrom the Micro Focus AppDelivery Marketplace, configure UFT and record/run your tests.
Few things you should note:
  • Local device testing is supported on one device at a time.
  • UFT mobile add-in for local device should be installed on a 64-bit Windows machine only. (Though UFT 14.52 can be installed on both 32 bit or 64 bit OS)
  • All devices supported on mobile center are supported by the UFT mobile add-in as well. Mobile Center supports all devices that meet the following OS requirements:
OS supported by Mobile Center

3.Run UFT tests on locked machine without manual login.

UFT 14.01 introduced the ability to run UFT tests on a locked remote machine. With this, we had to manually login to the remote machine, add the remote machine credentials in the UFT settings and UFT would then continue to test in case the machine gets locked.
With UFT 14.52, Micro Focus has moved a step ahead. They have removed the manual log-in need to the remote machine. Right from login to continued-testing-on-remote-machine-locking, can be achieved with the help of this new feature.
uft-remote-machine
Now we can run all tests from ALM, Jenkins or Windows tasks scheduler, without manual intervention .

4.Disable Regular Expression in Static Descriptive Programming.

As we are aware there are two methods of writing Descriptive Programming, static DP and dynamic DP. By default, UFT evaluates all property values in DP as regular expressions.
Dynamic DP already has the ability to turn off the regular expression for a particular property.
oDesc("name").RegularExpression= False

However, this was not available to static DP. All property values were treated as regular expressions. This has changed going forward with UFT 14.52. Using the newly introduced UftIsRegex property you can now turn off regular expression for static DP by setting its value to FalseTrue is the default value. If we don’t mention UftIsRegex property, all values will be treated as regular expressions.
Browser("micclass:=Browser").Page("micclass:=Page").WebEdit("type:=text",
"name:=userName","html tag:=INPUT","UftIsRegex:=False").Set"mercury"

In the above static DP statement, we have instructed UFT to NOT treat WebEdit object properties as regular expressions by writing an additional property UftIsRegex:=False.

5. Ability to select the property for test object's logical name.

Till now, UFT would use its internal magic to decide the logical name of an object.
logical-name-uft
With UFT 14.52, we can now configure UFT to select the property for a test object’s logical name. Go to Tools > Object Identification.
configure logical name object-identification
Optionally, we can use regular expression for the logical name.

6.Miscellaneous Enhancements in UFT 14.52 .

Parallel testing.

During Parallel Testing, we can now pass test parameters as well as data tables to your tests.

Multiple ChromeDriver versions.

Using WebUtil.AttachRemoteDebugging method, we can specify the path to the relevant chromedriver.exe stored on our computer.

StormRunner Functional.

A new option to log device metrics has been introduced when setting up mobile testing on Storm Runner Functional.
SRF device metrics

Jenkins

While running tests from ALM via Jenkins, we can now filter the tests in the test set we are running, instructing Jenkins to run only part of the test set. Also, we can now pass test parameters directly from our Jenkins command.
Reporting
General run error are a pain. They do not provide much info about the error we encountered. In UFT 14.52 and above, when a test would fail with a general error, the report would include a screen capture of the desktop at the time of the failure.
  • Earlier HTML reports would include the Actual vs Expected information only when a checkpoint would fail. Now it would include this information for both passed and failed checkpoints.
  • HTML reports have been performance optimized.

UFT AOM

  • Environment.LoadFromFile method gets a new optional parameter where we  can specify whether to save the loaded environment variable file with the test when the script saves the test.
  • Action.Location property is now read-write whereas in UFT 14.51 and earlier it was read-only. The property can now be set to the ALM location or a file system path.
  • MCConnection object now supports proxy information required for connecting to Mobile Center.

Usability

  • Now we get the ability to jump from function call in one function library to function definition in another library.
    fn-call-fn-definition
  • SAP table and grid objects gets a new GetCellDataEx method.
  • SAP GUI versions later than 740 DO NOT require SAP logon.ini file for UFT to be compatible.
  • The Test Combinations Generator now includes an Undo/Redo button.
  • Power Builder apps gets a new PbDataWindow.ActivateRow method to select a specified row in a PowerBuilder data window.

New Technology Support

  • Salesforce Lightning applications.
  • Constrained Application Protocol(CoAP) support for API testing.
  • Git 2.19, TortoiseSVN 1.11.0
  • Angular 7. Here is the complete support matrix for various versions of Angular.
    uft-angular-matrix
  • Bamboo server 6.7 (requires version 1.2.1 or later of the Bamboo plugin)
  • Dojo 1.14
  • FarPoint Spreadsheet 7.0
  • Java 11
  • Oracle EBS 12.2.8
  • QT 5.12
  • SAP Fiori 1.60
  • SAP NWBC 6.5 patch 13
  • SiebelOpenUI 18
  • Windows 10 1809
  • Firefox 64, 65, 66 beta
  • Chrome 71, 72, 73 beta
  • Edge support for SAP Fiori 1.44 and 1.52 SAPUI5 1.44 (recording, spying)
  • JxBrowser
  • UFT 14.52 is provided in the following languages: English, French, German, Japanese, Russian, Simplified Chinese.
Refer more information about UFT-14.52

Parameterization in UFT/QTP

1. What is Parameter and Prameterization ...?

A parameter like variable which contains a value. The value of the parameter can be assigned by the internal/external data source or generator.

Parameterization is the process of replacing the values with Parameters. When we replace the values with parameters, the test can have the facility of Data driving. 

2. What is difference between Parameterization and Data driving ...?

Parameterization enables to do data driving for a script. Running a script with different sets of data is called as Data Driving. Once a test is parameterized, we can run it by using different sets of data from external data sources like a excel sheets. This is called a data driven test.

3. Explain Types in Parameterization ...?

There are 4 types of Parameters

1. Datatable Parameters:  UFT has an in built Datatable which is used to store or retrieve values from, to script. Using Datatable parameters are useful to store or retrieve values from Datatable. We can even import external data to data table for later use in the script. This parameterization type is mainly used for DataDriven testing. 

2. Action Parameters: A Reusable Action can be called from another Action. We can send/retrieve values from, to the Action while calling it. For this Action Parameters are useful. 
Action Parameters are of two types.

a. Input Action Parameters: Useful to send values to an Action while calling it from other Actions.

b.Output Action Parameters: Useful to retrieve values from an Action while calling it from other Actions. 

3. Environment Parameters: Environment Parameters give environment information of UFT/QTP like what is the current OS, Current Test Name and current logged user ... etc.

Environment Parameters are useful to set the global values for a project or test. There are two types in Environment Parameters.

a. Built-in Environment Parameters: These are defined by UFT, and will have environment details of UFT.

b. User Defined Environment Parameters: These should be defined by a user, as a standard user will define application related environment like current execution environment , URL of the application ... etc..

User defined environment variables can be stored in outside of UFT. Those are called as external user defined environment variable.

4. RandomNumber Parameters: These are useful to generate random numbers between a specific range. The Random numbers can be generated for each Action or Test Iteration.

4. What Parameterization Types are useful for Data driven testing ..?

Datatable Parameterization is useful to data driven testing. Because we can send multiple rows of data from excel sheets by importing them in UFT. 

5. How do you parameterize the Data with External Data Sheet  .?


By importing that sheets to UFT, we can parameterize External Data sheet.


6. How do you prepare Data Driven Tests ... ?


After developing the script I Will parameterize  the data with datatable Parameters. I will import the data from an external data sheet and use that data in script. By this we can execute the test with multiple rows of test data.


7. How can you Export/Import Environment Variables ...?


Environment variables can be imported/exported from Test settings dialog.


Go to File-->Settings--->Environment--->Variable Type: User Defined. Here we can define environment variables by clicking on Add(+) button. After Adding Environment variables we can export them by clicking on export button. 



Using load variables and values from external file operation, we can specify external environment variable.

8. What type of data can be sent from one action to another... ?


We can send only below data types from one action to another. 

1. String 
2. Boolean
3. Date
4. Number
5. Password

9. How to send data from one action to another .. ?


We can use multiple techniques for  this.


Using Action Parameters: We can send values between actions but in order to perform this the action should be called from anothr action. 


Using Environment Parameters: The environment variables are global and we can create the environment variables and store the values in runtime. So we can directly access the values from one action to another without calling it. 


Using Data table parameters: The data table parameters are useful to store and retrieve values. We can store the values of one action and retrieve the same values from another action in runtime without calling an action from another. 


10. What type of data can be send between Actions ... ?


Using action/datatable parameters we can send only fixed values. But using the Environment parameters we can send any type of data between Actions. 



Monday 22 April 2019

Place the Cursor at the Beginning of a Text Label (VBScript)....


'The following example uses the SetCaretPos method to place the cursor at the 
beginning of the "X" static text label and then clicks the "Blocking reason" button.
When the button is clicked, a status bar message displays the operation that was 
performed.A checkpoint on the status bar verifies that the proper operation
was performed on the label.
SAPGuiSession("Session").SAPGuiWindow("Invoice Items").SAPGuiLabel("X")_
.SetFocus
SAPGuiSession("Session").SAPGuiWindow("Invoice Items").SAPGuiLabel("X")_
.SetCaretPos 0
SAPGuiSession("Session").SAPGuiWindow("Invoice Items")_
.SAPGuiButton("Blocking reason").Click
SAPGuiSession("Session").SAPGuiWindow("Invoice Items")_
.SAPGuiStatusBar("StatusBar").Check CheckPoint("StatusBar")

Synchronization

1. What is Synchronization.....?

When we run a script, the application may not respond with the same speed of script. Synchronization is the process of adjusting the time gap between Script speed and  Application speed.

2. How Synchronization Concept was implemented in your Project..... ?

We have used all the synchronization techniques in our project.

Synchronization Point:  We have used wait property for some of the situations where we have waited for the property values.

Wait:  We have used wait statement in some of the situations where we are not waiting for any object property/object. but we are waiting for data.

Exist:  We have used it for checking object existence.

Object Synchronization TimeOut:  UFT automatically uses this, UFT waits for an object to load before running a step in the test.

Sync:  We have used it for Browser and Page synchronization. 

3. An  Object is not identified by QTP, How much time does QTP wait.....?

This is dependent on how many seconds are specified in Object Synchronization TimeOut at File-->Settings--->Run--->Object Synchronization Timeout.

By default QTP waits for 20 seconds.

4. Browser("Gmail").Page("Gmail").WebButton("Login").Exist(10) In this statement the Button "Login" is not identified. How much time does QTP wiats ....?

This is waits for 10 seconds, When QTP is checking for an object using "exist" property, it will not consider object synchronization timeout..

5. What is the difference between Wait and WaitProperty ......?

Wait is mandatory and WaitProperty is Optional.

When Wait(10) is used, the test should wait for 10 seconds where as 10 seconds is optional for WaitProperty because this statement waits for a property value to be matched. Whenever the property value matches with in the specified timeout, the test will not wait for complete time.

6. What is the difference between Exist and WaitProperty ...?

These two are optional waits and the way how we use these two are different. The exist is applied to see the object existence, where as WaitProperty is to wait for a property of an existing object.

7. When to use Wait Property ...?

Wait property is useful when there is a need to wait for a property value of an object.

Ex: A status message to appear on an object, for a button to become enabled.

8. When to use Wait  ... ?

Wait statement is useful in some of the situation where we are not waiting for any object property/Object. But we are waiting for data.


Ex: After selecting a country in country list box, we might need to wait for some fixed time to load the states in states list box.



9. When to use Exist ...?

Exist is useful when we want to wait for a Window/Dialog/Object existence.

10. What is Object Synchronization Time Out ...?


QTP automatically uses this. QTP waits for an object to load before running a step in the test. This can be configured at File-->Settings-->Run--->Object Synchronization Timeout.

11. What is the maximum timeout for Object Synchronization Time Out ...?

1000 seconds.

12. What is Browser Navigation Timeout ....?

UFT automatically uses this. UFT waits for a webpage to load before running a step in the test. This can be configured at File-->Settings-->Web-->Browser Navigation Timeout.

13. I clicked on a link. What Synchronization technique is to be used to wait for loading the Page ..?

Sync  is useful in such situation because the page will get navigated when clicked on link .

14. In the Result Page, the Synchronization Point Result shows a warning . What does it mean ...?

This means that the synchronization point has reached the timeout and the property value has not matched.

15. What is ReadyState native property of a browser ...?

ReadyState is a native property for browser to tell the status of the browser navigation. This property contains any of the values from 0 to 4. Each value has a different meaning.

ReadyState=0 {Just initialized}
ReadyState=1 {Object currently loading its properties}
ReadyState=2 {Object was initialized}
ReadyState=3 {Object is interactive, but not all its data is available}
ReadyState=4 {Object has received all its data}


Sunday 21 April 2019

How to Enable SAP GUI Scripting

SAP GUI Scripting is required in order to Enable UI elements recognition in SAP GUI. User needs to update scripting setting by configuring his client, then the server system that user is connecting to. 

Below is the step by step process to enable SAP GUI scripting at Client and Server.

Enable scripting in Client SAP GUI

  1. Click Customize Local Layout, and then click Options.
Sap_Options.png


2. Under Accessibility & Scripting click Accessibility and then tick Use accessibility mode, click Ok to save.

User_Accb_Checked.png


3. Under Accessibility & Scripting, click Scripting and then tick Enable Scripting and remember to untick all checkbox below, click Ok to save. 

scripting_check.png

Enable Server Side Scripting (the RZ11 parameter)

1.Login to SAP, Start transaction RZ11

RZ11.png
 
2. On the Maintain Profile Parameters screen, enter “sapgui/user_scripting” and Click Display

RZ11_scripting.png

3. In the Display Profile Parameter Attributes screen, choose Change Value.

DisplayParemeters.png

4. Enter “TRUE” in the new value field, Click the Save Button.

Set_True.png

5. Check that Current Value is set to TRUE.

After_Set_True.png


6. Verify with the SAP Administrator that S_SCR authorization is granted for all required users.

NOTE

User need to restart SAP GUI after having changed the value from FALSE to TRUE on server side (RZ11)


Wednesday 17 April 2019

Configure UFT to Open a SAP Gui for Windows Application

'************************************************************************************************************************
'Description:
'
'This example starts UFT, opens a new test, and configures it for recording and running
'on an SAP Gui for Windows application.
'
'Assumptions:
'UFT is not open.
'************************************************************************************************************************

Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object

qtApp.SetActiveAddins Array("SAP") ' Load the SAP Add-in.
qtApp.Launch ' Start UFT
qtApp.New ' Open a new test

' Configure the SAP Record and Run settings to open an SAP Gui for Windows application with these settings:
qtApp.Test.Settings.Launchers("SAP").Active = True 'Open a new SAP Gui for Windows session when recording begins
qtApp.Test.Settings.Launchers("SAP").Server = "R/3 Enterprise" 'Launch SAP Gui for Windows and connect to the "R/3 Enterprise" Server
qtApp.Test.Settings.Launchers("SAP").AutoLogon = True 'Perform auto login using the logon details below
qtApp.Test.Settings.Launchers("SAP").Client = "800" 'Number for SAP client
qtApp.Test.Settings.Launchers("SAP").User = "QA01" 'User name for SAP server
qtApp.Test.Settings.Launchers("SAP").Password = "3f5aea819b0239" 'Password should be set as an encrypted string
qtApp.Test.Settings.Launchers("SAP").Language = "EN" 'Use English for UI language
qtApp.Test.Settings.Launchers("SAP").RememberPassword = True 'Save the logon password for use in future test runs
qtApp.Test.Settings.Launchers("SAP").CloseOnExit = True 'Close this SAP Gui for Windows session when exiting this test
qtApp.Test.Settings.Launchers("SAP").IgnoreExistingSessions = True 'Do not record or run tests on any SAP sessions that are already open prior to the start of the record or run session

qtApp.Visible = True ' Make the UFT application visible
Set qtApp = Nothing ' Release the Application object

Monday 8 April 2019

Recovery Scenarios

What is an Exception ?  How did we handle Exceptions in our Project
An exception is an unexpected or unwanted event or error   because of which application crashes leading to test failure.

We have used recovery scenarios to handle the exceptions. we have called functions within the recovery scenarios to handle these exceptions.

What are Recovery scenarios
While executing our scripts we  may get some UNEXPECTED/UNPREDICTABLE errors and window pop up errors. To “recover” the test (for continue running) from these unexpected errors we use Recovery Scenarios.

What Constitute Recovery Scenarios
Recovery scenario consists of the following types.
a. Trigger Event: The event that interrupts our run session. 
For example, a window that may pop up on screen or a UFT/QTP run error.

b. Recovery operations : The operations to perform to enable UFT to continue running the test after the trigger event interrupts the run session. 
For example, Clicking an OK button in a pop-up window or restarting Microsoft windows.
 
c. Post-Recovery Test Run Option: The instruction on how UFT/QTP should proceed after the recovery operations have been performed and from which point in the test UFT should continue, if at all. 
For example, we may want to restart a test from the beginig or skip a step entirely and continue with the next step in the test.

NOTERecovery scenarios are saved in recovery scenario files having the extension .qrs. A recovery scenario file is a logical collection of recovery scenarios, grouped according to our own specific requirements.

What is the process of creating a Recovery Scenarios 
The following are steps mentioned for creating recovery scenario.

  1. Defining the trigger event that interrupts the run session.
  2. Specifying the recovery operations  required to continue.
  3. Choosing a post-recovery test run operation.
  4. Specifying a name and description for the recovery scenario.
  5. Specifying whether to associate the recovery scenario to the current test and or to all new tests.

How Exactly does the Recovery Scenario Mechanism Works
When UFT/QTP gets an error, it will check for any associated recovery scenarios. If any recovery scenario is associated, then UFT will identify the Object/Condition specified in trigger event. If that Object/condition matches, then UFT executes the specified Recovery Operation. Specified Post Recovery Operation will also be executed after the Recovery Operation.

What are the Different reasons which will generate errors in your project 
If we get an error, that is because of 3 reasons..

1.Scripts Issue: A poor script development will give poor result. Because of this we get Test Run Errors.

2.Application Issue:  Application generates unwanted  pop ups or through's unexpected events in script run-time.

3.Environment Issue: Application suddenly crashes because of environment issue.

How do we handle the exceptions generated by application 
We have two types of Exceptions that will be generated by Application.

a. Unwanted popup windows: The unwanted/unexpected Popup windows will disrupt the Script and cause the failure. To handle them we have used Popup Recovery Scenario. In this, we have specified the window name and how to handle it by using a recovery operation.

b. Object Related Errors:  Sometimes we get errors like "Page cannot be displayed"  or an application is opened, due to an internal problem, the window is not responding and all of the objects are in disable state.  In this case, we can use Object State Recovery Scenario which will execute a Recovery Operation based on Object State that is already provided by me when creating it.

How do we handle the exceptions generated by UFT/QTP 
UFT generates exceptions and those are called as Test Run Errors. We can handle Only object and Object Data Related Test Run Errors. The errors are  

1.Object is disabled
2.Object not found
3.Object not visible
4.Item in Menu or List not unique
5.More than one Object Respond to its physical description
6.Item in Menu or List not found.

How do we handle the exception raised because of environment
An environment issue causes the Application Crash or No Response from the Application. For application Crashes we use the Application Crash Recovery Scenario. We can define a recovery scenario to set the application normal. For no Response we can use Object state Recovery scenario to perform a recovery operation.

What is trigger event 
Trigger event is an event that interrupts our run session which will cause Test Failure. This can happen in both UFT and Application. 

What is Recovery operation
The operation which recovers UFT to run the test after a trigger event interrupts the run session. 
  
What are the types in Recovery Operation 
1.Function Call: We can specify a function to be executed when performing the recovery operation.

2.Keyword or Mouse Operation:  In this there are multiple sub operations 
  1. Click Default button/ Press  the ENTER Key.
  2. Click Cancel button/ Press the ESCAPE key.
  3. Click button with label.
  4. Press key or Key combination
By using Click button with label, we can specify a button which is there in the application. By using Press Key or Key combination, we can specify a key to be pressed or with a combination ctrl/alt to be pressed in the recovery operation.

3. Close  Application Process:  We can specify a process to be closed when we get an error. It display current running list of processes in our machine. We can choose any of the process to closed when that Recovery Scenario is executed. 

Where do we write Recovery Functions 
We can write Recovery Functions in Libraries and specify those libraries when creating the recovery scenario. We can create libraries from UFT using Create new function library option. We can also use .vbs or .txt files as libraries.

How many recovery scenarios have been developed in your project 
We have developed over 10 recovery scenarios for below purposes : 
  1. To handle a message that is displayed when an ActiveX object on an Internet Explorer page may be unsafe.
  2. To handle Internet Explorer ASP errors.
  3. To handle a message that is displayed when a file is selected for download.
  4. To handle a message that is displayed when Internet Explorer is about to redirect to a new Internet site.
  5. To handle a message that is  displayed when an object cannot be fount in internet Explorer. 
  6. To handle security Alerts.
  7. To handle Application Generated Object Related Exceptions.
  8. To handle UFT/QTP Generated Exceptions.
  9. To handle Application Crashes
What are the Recovery Scenarios used in Your Project
We have used all of the recovery scenarios Popup, ObjectState, TestRunErrors and Application crash.

What is the extension for recovery scenario file
QRS---- Quicktest Recovery Scenario.

Loading Recovery scenarios at run time or dynamically 
Set qtApp = CreateObject("QuickTest.Application")
Set qtTestRecovery = qtApp.Test.Settings.Recovery
    
qtTestRecovery.Add"C:\TEST\Project\RecoveryScenario\Testfailurenote.qrs""TestFailing" , 1
qtTestRecovery.Add"C:\TEST\Project\RecoveryScenario\TestfailureNote.qrs""TestNote" , 2

For intIndex = 1 To qtTestRecovery.Count
      qtTestRecovery.Item(intIndex).Enabled = True
Next
qtTestRecovery.Enabled = true

qtTestRecovery.SetActivationMode "OnError"
Set qtApp = Nothing