SPONSORS:






User Tag List

Results 1 to 6 of 6
  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)

    Explicitly failing a test case

    Maybe I am trying to do this the wrong way, but...

    How do I force a test case to fail? I have 2 lists that I am comparing the contents of. Since the lists are of different sizes and I am only interested in comparing the portions of the lists that should be the same, I am using a loop. If I get to a point where the test case should fail, how do I explicitly make the case fail? I want the force a failure if the print statement "Fail" is reached.

    Below is the code I have:


    [-] for iLoop = iBasePos to iBaseCount
    [-] if (lsCurrent[iCurrPos] == lsBase
    [iLoop])
    [-] if (iCurrPos < ListCount(lsCurrent))
    [ ] iCurrPos = iCurrPos + 1
    [-] else
    [ ] print ("Verification Complete!")
    [ ] print ("Test Passed!")
    [-] else
    [ ] print ("Fail!")
    [ ] print (lsCurrent[iCurrPos], " != ",
    lsBase[iBasePos])
    [ ] break



    ------------------
    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
    Mar 2000
    Location
    pisctaway, NJ USA
    Posts
    188
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Explicitly failing a test case


    Use the raise statement.

    raise 1, "Your failure statment"

    Anthony

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

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

    Re: Explicitly failing a test case

    I think I am -finally- getting the hang of this - I found the entry for the Verify function. I -really- wish there was a good book on this program - I'm just a contractor so taking a class isn't an option.

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

  4. #4
    Senior Member
    Join Date
    Mar 2000
    Location
    pisctaway, NJ USA
    Posts
    188
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Explicitly failing a test case

    Yeah, it's that initial starting point.
    The online help is quite useful- if you know
    what your looking for....get very friendly
    with using the SEARCH feature.

    GOOD LUCK!

    Anthony


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

  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: Explicitly failing a test case

    You can also add a function to your test frame which allows verification without failure.

    [-] VerifySafely (ANYTYPE aActual, ANYTYPE aExpected optional, STRING sMessage optional)
    [ ] // ************************************************** **************l
    [ ] //
    [ ] // VERIFY WITHOUT THE TESTCASE EXITING
    [ ] //
    [ ] // ************************************************** **************
    [ ]
    [-] do
    [ ] Verify (aActual, aExpected)
    [-] except
    [ ] LogError ("{sMessage} {aActual} did not match {aExpected}")
    [ ]

    Hope this helps



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

  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: Explicitly failing a test case

    YES! Use the Library Browser. I lived there for the first year or so of using the prod.

    Good luck and thanks for the bugg free softwear. ;-)

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

 

 

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 02:20 PM.

Copyright BetaSoft Inc.