SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 7 of 7
  1. #1
    Senior Member
    Join Date
    Apr 2001
    Location
    Montreal, Quebec, Canada
    Posts
    324
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Recovery Scenario Sequence issue


    Hi All,

    I have a problem with the sequence of Recovery Scenarios.

    Scenario 10 - traps an error when an object it not found, this works fine.
    Scenario 11 - traps any error.

    The problem is that scenario 11 is being executed after scenario 10 ran successfully. I need to somehow disable or to not execute scenario 11 when scenario 10 was executed. Any suggestions?

    I am using QTP 9.2

    Cheers!!!
    Clemens

  2. #2
    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: Recovery Scenario Sequence issue

    Are you using function call for both scenarios or what?

  3. #3
    Senior Member
    Join Date
    Apr 2001
    Location
    Montreal, Quebec, Canada
    Posts
    324
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Recovery Scenario Sequence issue


    Each scenario has function calls, the first one has window popups events and the last scenario closes a process.

    Regards,
    Clemens

  4. #4
    Senior Member
    Join Date
    Sep 2001
    Location
    Chicago
    Posts
    161
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Recovery Scenario Sequence issue

    i undertand that you are closing particular process(es) when you recevie Any error (Scenario 11 executed). Cant you possibly do it in Scenario 10 itself. because Scenario 11 will always either supercede or get exected in case of any error out of QTP.
    ififthelement
    --------------
    "life is simple if you can see both sides of a coin" - by me

  5. #5
    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: Recovery Scenario Sequence issue

    A simple solution would be use boolean variables

    <font class="small">Code:</font><hr /><pre>
    ranRecoveryFunction1 = False
    ranRecoveryFunction2 = False

    Function RecoveryFunction1(Object)
    ranRecoveryFunction1 = True
    msgbox "First"
    End Function


    Function RecoveryFunction2(Object, Method, Arguments, retVal)
    If Not ranRecoveryFunction1 Then
    Msgbox "Second"
    ranRecoveryFunction1 = False
    End if
    End Function
    </pre><hr />

  6. #6
    Senior Member
    Join Date
    Apr 2001
    Location
    Montreal, Quebec, Canada
    Posts
    324
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Recovery Scenario Sequence issue


    Thanks for your comments, the idea of the boolean is good, this provides the flag needed to exit, however my problem is how to avoid executing the last recovery scenario, I need to avoid this execution only when scenario10 is executed.

    I have tried to disable the recovery scenario at running time, it does not work, it is still being executed.

    With the boolean flag I am using the command "ExitTestIteration", this kind of works. It exits the last recovery scenario the way I need it, but generates an error "Unspecified error", basically is not a clean exit.

    Does anyone have other ideas or suggestions?

    Regards,
    Clemens

  7. #7
    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: Recovery Scenario Sequence issue

    Here is the solution to your problem clemens

    <font class="small">Code:</font><hr /><pre>
    Class RecoveryExit
    Private lastFilter

    Sub Class_Initialize()
    lastFilter = Reporter.Filter
    Reporter.Filter = rfDisableAll
    ExitTestIteration
    End Sub

    Sub Class_Terminate()
    Reporter.Filter = lastFilter
    End Sub
    End Class

    Function RecoveryFunction2(Object, Method, Arguments, retVal)
    Dim x
    Set x = new RecoveryExit
    End Function

    </pre><hr />

 

 

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 7.69%
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 03:35 AM.

Copyright BetaSoft Inc.