SPONSORS:






User Tag List

Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Dec 2001
    Location
    Windsor, ON, Canada
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Looping through records

    Hello all,
    I have a database filled with profiles to be entered into an application. I can read the data through SQL in a testcase, and loop through each record. The disadvantage of this, however, is if one entry fails, the testcase fails and the remaining records will not be entered.

    What I need is to loop through the records. Validate the entry and results. If there is an error, log it and proceed to the next record. How can I do this?

    Thank you,

    Patrick Briand

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

  2. #2
    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: Looping through records

    Is the error an error you are raising in the event the verification isn't as expected? Or is SilkTest raising an error? If SilkTest is raising the error, try wrapping your verification in a do/except. in the except put in a LogError to log the error to the results file.

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

  3. #3
    Junior Member
    Join Date
    Dec 2001
    Location
    Windsor, ON, Canada
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Looping through records

    Hi,

    Thanks for your input, however I have over 100 fields to verify. It would actually save more time for me to simply have that particular scenario/testcase fail and then proceed with the next scenario entry. Can I loop a testcase? If I could do this, I can define the variables, run the testcase X times, log the failures and have the results I need.

    Thanks,

    Patrick Briand
    Compu-Quote Inc.

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

  4. #4
    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: Looping through records

    Yes. Just put a loop around the testcase in the 'main()' function of your .t file

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

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

    Re: Looping through records

    The do...Except will be the best choice for this problem rather than looping.........

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

  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: Looping through records

    Agreed, the Do... Except... is a better choice.


    [This message has been edited by DJGray (edited 02-06-2002).]

 

 

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 09:14 AM.

Copyright BetaSoft Inc.