SPONSORS:






User Tag List

Results 1 to 10 of 10
  1. #1
    Member
    Join Date
    Jan 2001
    Location
    Fairfield, CT, USA
    Posts
    86
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Loop for testcase in SilkTest

    Hi All
    I need for loop code to run testcase. If I do-Integer i
    for i = 1 to 5
    Print (i)
    It will print 5 times but I want to see testcase running 5 times as do regular run testcase.Please someone can write for loop from which I can see testcase running.
    Thank in Advance

    [This message has been edited by PalS (edited 02-01-2001).]

  2. #2
    Senior Member
    Join Date
    Jul 1999
    Location
    New York, NY, USA
    Posts
    137
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Loop for testcase in SilkTest


    [This message has been edited by woodman (edited 02-01-2001).]

    [This message has been edited by woodman (edited 02-01-2001).]

  3. #3
    Super Member
    Join Date
    Jul 1999
    Location
    Rancho Santa Margarita, CA
    Posts
    1,439
    Post Thanks / Like
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: Loop for testcase in SilkTest

    Raul,

    The Help file examples did not show multiple statements inside the for loop unfortunately but, if you have done an extra effort of looking up all the topics regarding the "for" statement or if you have tried to use "begin" and "end" in your "for" loop, you probably would have gotten the answer to your question -- which is "there is no begin/end in the "for" loop" in 4Test.

  4. #4
    Senior Member
    Join Date
    Sep 2000
    Posts
    159
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Loop for testcase in SilkTest

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

    The Help file examples did not show multiple statements inside the for loop unfortunately but, if you have done an extra effort of looking up all the topics regarding the "for" statement or if you have tried to use "begin" and "end" in your "for" loop, you probably would have gotten the answer to your question -- which is "there is no begin/end in the "for" loop" in 4Test.
    <HR></BLOCKQUOTE>

    Thanks,

    SO if I understand correctly, it is not possible to have multiple statements in the body of a for loop?

    I have to put the body within a testcase()?

    This seems very strange. I think C has this capability and 4test claims to be similar to C.

  5. #5
    Senior Member
    Join Date
    Sep 2000
    Posts
    159
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Loop for testcase in SilkTest

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

    [This message has been edited by woodman (edited 02-01-2001).]

    [This message has been edited by woodman (edited 02-01-2001).]
    <HR></BLOCKQUOTE>

    Also, is there any "begin" and end if you want multiple statements in a for loop body?
    The help file did not explain how to do this.

    For(i=1;i<Count;++i)
    begin
    statemen1
    statement2
    end for


  6. #6
    Senior Member
    Join Date
    Jul 1999
    Location
    New York, NY, USA
    Posts
    137
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Loop for testcase in SilkTest

    I must not understand what your getting at. Silktest will support a for loop structured exactly as C. Any statements you want can be contained within that loop. If you are looking to exicute a different statement each time you loop you may need to create a data driven testcase where you read each statement into the loop.

    I am not a C programmer (but am familiar with C)and have been using 4Test for quite a while, most often it is better to enclose the loop within the testcase if you want to repeat the same actions over and over again, because you can set an appstate that gets you where you want to be before the test, and within the test you can control the error handling.

    If you use the main () abouve and execute 100 testcases within it but loop one of them 50 times, if it bombs you will have a 33% failure rate. If it runns fine it will pad your test completions by 50 instead of one. To be honest I don't rely too much of Silk's metrics, I don't use planner. I develope my tests independent of each other and put them into a main loop so that I can feed them data variables and selectivly execute them.

    Hope this helps.

    I aslo tend to use for(i=1;i<=iINT;i++) or whatever so that I can drop different values into the loop or nested loops.

  7. #7
    Super Member
    Join Date
    Jul 1999
    Location
    Rancho Santa Margarita, CA
    Posts
    1,439
    Post Thanks / Like
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: Loop for testcase in SilkTest

    Raul,

    I guess I have to put it in another way...
    The "for" loop statement in SilkTest does not use the "Begin" and "End" that you are looking for. But, you can have multiple statements in the loop - just don't put the "Begin" and "End".
    If you search the Online Help, you won't find any topic about Begin/End in a "for" loop. And if you try to write a simple testcase with a "for" loop and include multiple statements in there, you'll find that it works!

  8. #8
    Senior Member
    Join Date
    Aug 1999
    Location
    San Diego, CA USA
    Posts
    219
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Loop for testcase in SilkTest

    Maybe this will help. In SilkTest you "imply" the Begin and End points with your indentation of the lines that you are thinking belong between the Begin and End.

    There are loads of such examples in the online help. Just be sure that you actually have the lines indented and NOT that they just have a TAB character at the beginning of the line. The diamond that display as the left-most displayable character in the editor is there to indicate the indentation level. See "indent" in the online help if you don't know how.

    [This message has been edited by pcostigan (edited 02-02-2001).]

  9. #9
    Senior Member
    Join Date
    Jun 2000
    Location
    Sunyyvale CA USA
    Posts
    422
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Loop for testcase in SilkTest

    make your testacse as a public function and call it in a loop in a testacse

    public Func_name ()
    //code goes here

    testcase implement () appstate none
    for i = 1 to 5
    Func_name ()//Indent this statement to right hand side
    Sree

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

    Re: Loop for testcase in SilkTest

    As pcostigan wrote, the indentation creates "blocks" with implied begin and end.

    To see this, bring up any ".t" file, then look at the bottom selection of the "Edit" menu in SilkTest.
    It is labeled "Visual 4Test" and it has a checkmark next to it.
    Uncheck it and you will see your code in the old "QA Partner" style, with set brackets "{}" marking "begin" and "end".

    I think we all prefer the "Visual" style :-)

    -Rob
    Rob Kapteyn, CSTE
    RobKapteyn@gmail.com

 

 

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:11 PM.

Copyright BetaSoft Inc.