SPONSORS:






User Tag List

Results 1 to 6 of 6
  1. #1
    Senior Member
    Join Date
    Mar 2003
    Location
    Portland, OR
    Posts
    121
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Recovering from failures?



    All,

    I am testing a web app that consists of several forms spread across several pages. I have structured it such that I have declared my testcases in an include file and compile that file at runtime to gain the functionality that it contains.

    I then have a script that contains various variable declarations with a main() function. Inside the main function are the calls to the various testcases, from the include file that I use during the execution of the script. The script is structured to login to a server, run the set of testcases, login to the next server, run the set of testcases, etc., until all servers have had the automation executed against them. What I want to do is, if any of the called testcases fails, i.e. missing control, etc., then I want the script to start over.

    If I understand it correctly, the recovery system should cause this to happen, however it doesn't seem to be working. Currently, if the script fails to find a control on a page, it just bails and halts execution. How do I configure my script/SilkTest to recover from a failure and start back at the beginning?

    Thanks,

    -John


    ------------------

  2. #2
    Senior Member
    Join Date
    Jul 2000
    Posts
    117
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Recovering from failures?

    Start by taking a look in the help for the default ScriptEnter, ScriptExit, TestcaseEnter and TestcaseExit and how to override them. Then, look at the default code for these in the Silk directory (some are empty functions ...).

    One way to approach your problem is to override some / all of these to implement the behavior you desire.

    See also the help on do ... except. This may be another way to (as I discuss below) catch the exception and "move on".

    In a nutshell, it sounds like overriding the TestcaseExit so that it doesn't throw an exception -- or simply catching the exception -- might be what you're after. You'll probably need a bit of added logic to ensure that you continue to iterate your server list in your main ...

    Experiment -- and holler if you need some more help.


    ------------------


    [This message has been edited by Brent Rolland (edited 05-20-2003).]

  3. #3
    Member
    Join Date
    May 2003
    Posts
    51
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Recovering from failures?

    Yes,

    One way to slove this problem by using, do.. except function.



    ------------------
    KG Jawahar,
    kgjawahar@yahoo.com
    India
    KG Jawahar,
    kgjawahar@yahoo.com
    India

  4. #4
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Recovering from failures?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by John Wolf:

    ... What I want to do is, if any of the called testcases fails, i.e. missing control, etc., then I want the script to start over.
    <HR></BLOCKQUOTE>
    I must be missing something here. Why bother to restart the full suite when after a failure has been detected? Since the app' can't fix itself, I'd think you'd instead want it to just continue on to complete the rest of the run. If you are encountering a timing issue, there are other better ways to address it. (Is this suite intended as an unending load or stress test as opposed to a single-pass function test?)

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>
    If I understand it correctly, the recovery system should cause this to happen, however it doesn't seem to be working. Currently, if the script fails to find a control on a page, it just bails and halts execution. How do I configure my script/SilkTest to recover from a failure and start back at the beginning?
    <HR></BLOCKQUOTE>
    Recovery's purpose is not to restart from the beginning. It's intent is to reset a common base state so that subsequent tests can continue to operate after a failure has been detected.

    Look carefully at the point at which execution stops within your code. If you are outside the scope of a testcase at that point, Silk will stop and scriptexit will be called. If you are within a testcase, testcaseexit will be called; Silk should continue with the next testcase. Also, make sure you aren't calling "exit" anywhere.


    John


    ------------------

  5. #5
    Senior Member
    Join Date
    Mar 2003
    Location
    Portland, OR
    Posts
    121
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Recovering from failures?

    The reason I want to start over is because I'm running this in a loop, the first step being to login to a server. When I start over, what I really want is to bail on the set of cases for the current server, since we have a failure there's no reason to continue, so when it starts over, it should login to the next server and start back at the beginning of the loop so the scripts are executed on the next server.

    Basically this:

    Login to server a
    while not failing
    run some testcases
    login to server b
    while not failing
    run some testcases

    etc...

    I do not want to have to include logic for each server, I want one loop for all logic that will subsequently execute on the next server, if something fails, login to the next server and start back at the top.

    Make sense?

    ------------------

  6. #6
    Senior Member
    Join Date
    Oct 2002
    Location
    Calgary, Alberta, Canada
    Posts
    101
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Recovering from failures?

    I have a setup that does that. I have one script file that has a list of server names. i.e. list of string ServerList={...} I then do a "for each" just after the main() and begin with:
    [ ] Browser.Invoke ()
    [ ] Browser.Maximize()
    [ ] Browser.CloseOthers()

    I then have anif statement that starts out "if {Server}.Exists()"
    with the test cases in the scope of the if statement. If that is FALSE, I capture the screen in the else portion and continue on to the next URL in the server list.


    ------------------
    Beware of bugs in the above code; I have only proved it correct, not tried it."
    --Donald Knuth


    [This message has been edited by signal_11 (edited 05-22-2003).]
    Beware of bugs in the above code; I have only proved it correct, not tried it.
    --Donald Knuth

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin 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:50 PM.

Copyright BetaSoft Inc.