SPONSORS:






User Tag List

Results 1 to 6 of 6

Thread: Cleanup

  1. #1
    Junior Member
    Join Date
    May 2002
    Location
    San Jose, CA
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cleanup

    I have a couple of test cases written. How do I get SilkTest to perform a cleanup (i.e. close the AUT) after the last test case has finished?

    ------------------
    Robin L. Siebler
    Software Test Engineer
    Palm
    -------------------------
    Garunteed to be bug free
    Robin L. Siebler
    Software Test Engineer
    Palm
    -------------------------
    Garunteed to be bug free

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

    Re: Cleanup

    Two ideas-

    If you are customizing your recovery system, then you could put myapp.Close() in ScriptExit()

    If not, you could call your testcases from Main() in your script, then put myapp.Close() after the last testcase is called.

    I am sure there are other ways, those were just the most obvious to me.

    ------------------
    Tom
    Tom

  3. #3
    Senior Member
    Join Date
    Jun 2000
    Location
    Chicago, IL USA
    Posts
    383
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Cleanup

    This is what SilkTest "appstates" are for. See SilkTest help for instructions.

    Appstates do not actually do cleanup after a testcase is done, but, they do what is essentially the same thing -- they cleanup before the next testcase starts running.

    This can make you test suite run faster, because you do not need to restart the application for every testcase (only for those where starting the application is part of what the testcase is trying to verify).

    I usually define a few basic appstates like:

    appstate AppNotRunning()
    appstate AppLoggedOff()
    appstate AppLoggedOnDefaultUser()
    appstate AppLoggedOnAdministrator()

    ------------------
    Rob Kapteyn

    [This message has been edited by RobKapteyn (edited 06-06-2002).]
    Rob Kapteyn, CSTE
    RobKapteyn@gmail.com

  4. #4
    Senior Member
    Join Date
    Jul 1999
    Location
    Bellingham, WA USA
    Posts
    1,323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Cleanup

    This may go a bit deeper though...

    There are cases where your script writes files, deletes files, manipulates the registry, etc.

    Some thoughts that might give you a direction to go:

    All my tests are derived from a TestObject in the include file. This TestObjects has four methods; SetUp() NonBrowserTests() BrowserTests() and CleanUp().

    It is during CleanUp that all those messes above need to be undone.

    Another method we have used in the past was to use a RestoreMachines() method that was called between each TestCase. It was sort of a "snapshot restoration" that would reset Reg values and restor directories to their original condition. It was a fairly involved process and time-costly, but necessary because our scripts were just merciless to the machines and created conditions that invalidated subsequent testing.



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

  5. #5
    Senior Member
    Join Date
    Jul 1999
    Location
    Burlingame CA 94010
    Posts
    502
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Cleanup

    SIlk executes a function called DefaultTestCaseExit when a testcase concludes. This function reports any errors that have occured in the testcase.

    If you define TestCaseExit (BOOLEAN bExcept) in your frame, this function will execute each time a testcase concludes. Inside the function, do any cleanup you want and then call DefaultTestCaseExit (bExcept). This will report errors as normal, but allow you to completely customize what happens each time a test ends.

    Hope this helps

    ------------------
    John W Green
    jwgreen@automationexpertise.com
    http://www.automationexpertise.com

  6. #6
    Member
    Join Date
    May 2001
    Location
    Santa Clara, CA, USA
    Posts
    57
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Cleanup

    I do exactly the same thing in my code as John said. I have a TestcaseExit function that gets called at the end of every testcase and here I do all the cleanups and also write the results of the testcase to my HTML file.
    Just to add I also write the functions ScripExit and TestPlanExit, using these functions I do additional cleanups at the script level and also at the testplan level. And also these functions helps me to write consolidated results to the HTML file at the end of each testscript and then finally at the end of each testplan. I have multiple subplans that I call from a main plan. So this approach is very convinent to do the clenups as well as get the consolidated results at runtime

 

 

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 12:46 PM.

Copyright BetaSoft Inc.