SPONSORS:






User Tag List

Results 1 to 10 of 10
  1. #1
    Senior Member
    Join Date
    Nov 1999
    Location
    Eagle, ID,USA
    Posts
    1,035
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: how to know if a series of testcases all passed

    how about keeping track of errors with something like this:

    INTEGER iErrorCount,iErrorCount2 = 0;
    main()
    {
    tc1();
    tc2();
    if (iErrorCount2 == 0)
    tcn();
    }
    testcase tc1()
    {
    iErrorCount = GetTestCaseErrorCount ( );
    iErrorCount2 = iErrorCount2 + iErrorCount;
    }

    testcase tc2()
    {
    iErrorCount = GetTestCaseErrorCount ( );
    iErrorCount2 = iErrorCount2 + iErrorCount;
    }

    testcase tcn()
    {
    LogError("Error");
    iErrorCount = GetTestCaseErrorCount ( );
    iErrorCount2 = iErrorCount2 + iErrorCount;
    }

    so all of your testcases will get the current testcase error count and then add it to the iErrCount2 global var

    ------------------
    Have you ever noticed? Anybody going slower than you is an idiot, and anyone going faster than you is a maniac.

  2. #2
    Junior Member
    Join Date
    Dec 2001
    Posts
    23
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to know if a series of testcases all passed


    Inside my main () i have code like this

    main ()
    tc1() // testcase 1
    tc1() // testcase 2
    ....
    tcn() //testcase n

    after tcn() is complete how can I know if
    tc1() .. tcn() all passed. Is there a
    way to know that.

    The reason I want to do this is that i want
    the next set to testcases to start if and
    only if the earlier set has gone thru ( with
    all testcases in the earlier set passing )

    any ideas



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

  3. #3
    Senior Member
    Join Date
    Aug 2000
    Posts
    192
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: how to know if a series of testcases all passed

    no answer for you. it is best practice to have testcases run independent of each other. Might ask James or Dave Reed

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

  4. #4
    Super Member
    Join Date
    Jul 2001
    Location
    Earth
    Posts
    1,882
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: how to know if a series of testcases all passed

    Modify the recovery system to keep track of failed testcases like this:

    LIST OF STRING lsFailedTestCases = {}
    TestCaseExit (BOOLEAN bException)
    if (bException)
    ListAppend (lsFailedTestCases, GetTestCaseName ())
    ExceptLog ()
    else
    do
    @"Browser".WaitForReady ()
    except
    SetBaseState ()

    This way you can query the global variable to see which testcases failed.

    in a script you could call:
    main ()
    MyTestCaseName ()
    if (ListFind(lsFailedTestCases, "MyTestCaseName")==0)
    MyNextTestcase ()

    where MyNextTestcase is the name of the testcase to be called only if the first one named MyTestCaseName passes

    ------------------
    James Soderborg
    http://www.ameliortech.com
    jamesso@ameliortech.com

    [This message has been edited by jamesso (edited 03-21-2002).]

  5. #5
    cag
    cag is offline
    Junior Member
    Join Date
    Jun 2001
    Location
    Westwood,MA,USA
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: how to know if a series of testcases all passed

    Ver 5.5 has the ability to store the results (.res) in MS SQL as well as HTML. Check the Results Logging White Paper.pdf in the 5.5 documentation directory.

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

  6. #6
    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: how to know if a series of testcases all passed

    I set a variable bAllTestsPassed and bTestPassed. If anything fails, bTestPassed is set to FALSE and bAllTestsPassed will fail.


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

  7. #7
    Senior Member
    Join Date
    Nov 2000
    Location
    Bloomington, IL
    Posts
    142
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: how to know if a series of testcases all passed

    Write your completion data to an .ini file and then read from the file to get the results to determine if you should go on with your tests.

    MikeF

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

  8. #8
    Member
    Join Date
    Dec 2001
    Location
    chennai,TN,India
    Posts
    30
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: how to know if a series of testcases all passed

    The best way is to use a Boolean variable.When a testcase fails set the value to false.Check the value before you proceed with the next set of testcases.

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

  9. #9
    Junior Member
    Join Date
    Dec 2001
    Posts
    23
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: how to know if a series of testcases all passed

    Thanks for all the replies. This is what I did finally..


    list of string lsFailedTestCases = {}

    main ()

    tc1 ( args)
    tc2 ( args)
    ...
    tcn ( args)

    logger.write ("log_act_cit_1", ListCount (lsFailedTestCases)> 0 ? "FAILED": "PASSED")
    logger.ListWrite (lsFailedTestCases, "DEBUG(failed testcases (if any)):" )
    lsFailedTestCases = {}

    .. continue...


    -- end of main () ----

    also declared TestCaseExit () in the .t file


    TestCaseExit (BOOLEAN bException)
    if (bException)
    ListAppend (lsFailedTestCases, GetTestCaseName ())
    DefaultTestcaseExit ( bException )




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

  10. #10
    Junior Member
    Join Date
    Dec 2001
    Posts
    23
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: how to know if a series of testcases all passed


    [correction to earlier post]

    the condition inside TestCaseExit should
    be

    if (bException | | GetTestCaseErrorCount ( ) > 0 )

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

 

 

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:47 AM.

Copyright BetaSoft Inc.