SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 7 of 7
  1. #1
    Junior Member
    Join Date
    May 2008
    Posts
    29
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How to programatically find no of recovery scenari

    Hi ,

    I was tying to find out if there is any way of programatically finding out the recovery scenario count associated with you test .

    Something like a recoveryscenario.count .

  2. #2
    Member
    Join Date
    Jul 2008
    Posts
    42
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to programatically find no of recovery sce

    create a object of type recovery
    '************************************************* ************************************************** *********************

    'Description:

    '

    'This example uses the Recovery collection to specify a set of

    'recovery scenarios to associate with a new test.

    '

    'Assumptions:

    'There is no unsaved test currently open in QuickTest.

    'For more information, see the example for the Test.SaveAs method.

    '************************************************* ************************************************** *********************



    Dim qtApp 'As QuickTest.Application ' Declare the Application object variable

    Dim qtTestRecovery 'As QuickTest.Recovery ' Declare a Recovery object variable

    Dim intIndex ' Declare an index variable



    ' Open QuickTest and prepare objects variables

    Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object

    qtApp.Launch ' Start QuickTest

    qtApp.New ' Open a new test

    qtApp.Visible = True ' Make the QuickTest application visible

    Set qtTestRecovery = qtApp.Test.Settings.Recovery ' Return the Recovery object for the current test



    If qtTestRecovery.Count > 0 Then ' If there are any default scenarios specified for the test

    qtTestRecovery.RemoveAll ' Remove them

    End If



    ' Add recovery scenarios

    qtTestRecovery.Add "C:\Recovery.qrs", "ErrMessage", 1 ' Add the "ErrMessage" scenario as the first scenario

    qtTestRecovery.Add "C:\Recovery.qrs", "AppCrash", 2 ' Add the "AppCrash" scenario as the second scenario

    qtTestRecovery.Add "C:\Recovery.qrs", "ObjDisabled", 3 ' Add the "ObjDisabled" scenario as the third scenario



    ' Enable all scenarios

    For intIndex = 1 To qtTestRecovery.Count ' Iterate the scenarios

    qtTestRecovery.Item(intIndex).Enabled = True ' Enable each Recovery Scenario (Note: the 'Item' property is default and can be omitted)

    Next



    ' Enable the recovery mechanism (with default, on errors, setting)

    qtTestRecovery.Enabled = True



    'Ensure that the recovery mechanism is set to be activated only after errors

    qtTestRecovery.SetActivationMode "OnError"

    'OnError is the default, the other option is "OnEveryStep".





    Set qtApp = Nothing ' Release the Application object

    Set qtTestRecovery = Nothing ' Release the Recovery object







    Description
    The number of the recovery scenarios associated with the open test or business component.

    Syntax
    object.Count


    Argument Description
    object An expression evaluating to an object of type Recovery.

    Value Type
    Read-only. A Long value.

    this is the concept of AOM.......
    i think this will help you........

  3. #3
    Member
    Join Date
    Jul 2008
    Posts
    42
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to programatically find no of recovery sce

    you can perform various operations with the help of object of type recovery.......
    You can get some more details in QTP help itself.....

  4. #4
    Senior Member
    Join Date
    Dec 2002
    Location
    India
    Posts
    120
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to programatically find no of recovery sce

    Dipti

    Have you tested the script before posting??

    I too saw this in online help but the recoverscenario.count does not return the count of recovery scenario in the test

    BELOW CODE FROM HELP
    Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object

    qtApp.Launch ' Start QuickTest

    qtApp.New ' Open a new test

    qtApp.Visible = True ' Make the QuickTest application visible

    Set qtTestRecovery = qtApp.Test.Settings.Recovery ' Return the Recovery object for the current test
    <quote>
    <b>msgbox qtTestRecovery.Count</b>
    </quote>

    It always returns '0' inspite of adding multiple scenarios to the test/default settings
    cheers

  5. #5
    Member
    Join Date
    Jul 2008
    Posts
    42
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to programatically find no of recovery sce

    i saw this in Quick test automation reference help.......
    if we create an object for recovery....
    then it has a method called count.........
    and it has been written in the help itself that it will give The number of the recovery scenarios associated with the open test or business component.

    i too tried this code just now but its giving output 0

    Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
    Dim qtTestRecovery 'As QuickTest.Recovery ' Declare a Recovery object variable
    Dim intIndex ' Declare an index variable
    Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
    Set qtTestRecovery = qtApp.Test.Settings.Recovery ' Return the Recovery object for the current test
    var1=0
    If qtTestRecovery.Count > 0 Then ' If there are any default scenarios specified for the test
    var1= qtTestRecovery.Count
    msgBox var1
    End If
    msgBox var1

    i don't know what is the problem....
    may be we are committing some mistakes in writing the code.........
    but its clearly written in help file that it should return the no of recovery scenarios........
    i am sorry it didn't worked for me too........

  6. #6
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: How to programatically find no of recovery sce

    Look at

    Recovery object in QTP help file.

  7. #7
    Member
    Join Date
    Jul 2008
    Posts
    42
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to programatically find no of recovery sce


    Thanks a lot Tarun Its working fine.......
    i got confused with AOM concept.....
    and thought that it will be resolved with it.....

    here is the code.....
    val1 = Recovery.Count
    msgbox val1,, "Number of Recovery Scenarios"
    msgbox Recovery,, "Is Recovery enabled?"

    Its working fine now.........

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 01:47 PM.

Copyright BetaSoft Inc.