Micro Focus QTP (UFT) Forums
Loading QRS files at Run time - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: Loading QRS files at Run time (/Thread-Loading-QRS-files-at-Run-time)



Loading QRS files at Run time - dvkbabu - 03-19-2009

Hi,

I have generated script from Test Settings window(QTP 9.2), collected the script specific to Recovery tab and made a VBS function. I have executed the function and observed the Recovery Tab of Test Settings window. Scenario Names are displayed but "Activate recovery Scenarios:" drop down doesn't show the mode("OnEveryStep") that we have given in the Script. Its showing default option 'On error'. Is any thing that I need to include in the script? Please provide work around for this.

And also provide(if there is work around) alternative solution to load QRS file scenarios at run time.

Following is the function that I have executed

Sample Script:
--------------

Code:
Public Function Qrs()

Dim App
Set App = CreateObject("QuickTest.Application")

App.Test.Settings.Recovery.Enabled = True
App.Test.Settings.Recovery.SetActivationMode "OnEveryStep"
App.Test.Settings.Recovery.Add "C:\Automation\Registration\Recovery Scenarios\Security.qrs", "SecurityAlert", 1
App.Test.Settings.Recovery.Item(1).Enabled = True

End Function

Thanks,
Vijay


RE: Loading QRS files at Run time - SaiAbhi - 08-19-2010

Reg: Loading QRS files at Run time

Hi Vijay,
Did u find any solution for this,
Im facing same issue, Please let me know

Thanks,
Abhi


RE: Loading QRS files at Run time - UrmilaSaha - 03-24-2017

(03-19-2009, 04:51 PM)dvkbabu Wrote: Hi,

I have generated script from Test Settings window(QTP 9.2), collected the script specific to Recovery tab and made a VBS function. I have executed the function and observed the Recovery Tab of Test Settings window. Scenario Names are displayed but "Activate recovery Scenarios:" drop down doesn't show the mode("OnEveryStep") that we have given in the Script. Its showing default option 'On error'. Is any thing that I need to include in the script? Please provide work around for this.

And also provide(if there is work around) alternative solution to load QRS file scenarios at run time.

Following is the function that I have executed

Sample Script:
--------------

Code:
Public Function Qrs()

Dim App
Set App = CreateObject("QuickTest.Application")

App.Test.Settings.Recovery.Enabled = True
App.Test.Settings.Recovery.SetActivationMode "OnEveryStep"
App.Test.Settings.Recovery.Add "C:\Automation\Registration\Recovery Scenarios\Security.qrs", "SecurityAlert", 1
App.Test.Settings.Recovery.Item(1).Enabled = True

End Function

Thanks,
Vijay




Hello There , I have created the recovery Scenario. At UFT Setting ,  Setting-->Recovery--> Add recovery Scenario I have add all the Recovery Scenario And  Its working fine when I am Executing Locally. But According to my frame work its not working when I am executing from ALM.     So I am trying to Load Recovery Scenario at Runtime.  I am getting below error    ""TestRetailing" is not a valid recovery Scenario"

Below my  Code:

Function  LoadRecovery()
    
Set qtApp = CreateObject("QuickTest.Application")
Set qtTestRecovery = qtApp.Test.Settings.Recovery
    
qtTestRecovery.Add "C:\TEST\Project\RecoveryScenario\Test Retailing note.qrs""TestRetailing" , 1
qtTestRecovery.Add "C:\TEST\Project\RecoveryScenario\Test Note.qrs""TestNote" , 2


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

qtTestRecovery.SetActivationMode "OnError"
Set qtApp = Nothing 

    
End Function