SPONSORS:






User Tag List

Results 1 to 8 of 8
  1. #1
    Senior Member
    Join Date
    Mar 2001
    Location
    Moutain view/US
    Posts
    174
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to run a Script \"N\" times?

    I want to run my script continuously for 10 times ..How can i do it ?

    Thanks

    Loga

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

  2. #2
    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 run a Script \"N\" times?

    3 ways of doing it (That I can think of this early in the AM).....

    1 - If your script is just a file with a bunch of testcases in it.... Write a main function in the script that will call each testcase in a loop like this:
    2 - Your script already has a main function that calls testcases.... rename your main function to something else like 'MyCoolScript'. Then create another main function in it that calls your new function in a loop similar to example 1

    3 - Create a Suite file (.s extension) and call the script 10 times like a batch file:


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

  3. #3
    Senior Member
    Join Date
    Mar 2001
    Location
    Moutain view/US
    Posts
    174
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to run a Script \"N\" times?

    Thanks for the reply .i tried the Option 1 and option 3 and i failed using option 1 .

    My 4test script file looks like this

    [-] testcase Test1 () appstate none
    [+] recording
    Recorded actions ...


    I used the for loop as follows

    main ()
    Integer i=1
    for i =1 to 10
    [-] testcase Test1 () appstate none
    [+] recording
    Recorded actions ...


    And finally i ended with the error message Syntax error .


    Any idea ?


    Thanks

    Loga

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

  4. #4
    Senior Member
    Join Date
    Nov 2001
    Location
    UK, Oxford
    Posts
    150
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to run a Script \"N\" times?

    You seem to be declaring a testcase ten times in your loop. Look back carefully at the original example and you will see he is simply calling a bunch of testcases over and over again, he is not making a declaration inside of the loop. Obviously if you keep declaring the same function you will get errors

    ------------------
    Tempus fugit, Carpe Diem, et al

  5. #5
    Senior Member
    Join Date
    Nov 2001
    Location
    UK, Oxford
    Posts
    150
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to run a Script \"N\" times?

    So do something like this:




    ------------------
    Tempus fugit, Carpe Diem, et al

  6. #6
    Junior Member
    Join Date
    Nov 2002
    Location
    Minsk, Belarus
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to run a Script \"N\" times?


    You can use batch files (pretty good way, I think):
    =======start_script_10_times.bat=======
    @echo off
    set SCRPT=c:\work\auto\test.t
    set SCRES=c:\work\auto\test.res
    set TIMS=10
    for /l %%i in (1,1,%TIMS%) do call 2.bat %%i
    =======================================

    =================2.bat=================
    @echo off
    echo Running %SCRPT%... (%1 of %TIMS%)
    start "Running %SCRPT%. (%1 of %TIMS%)" /WAIT "%SEGUE_HOME%\partner.exe" -q -r %SCRPT%
    ren %SCRES% %SCRES%.%1
    echo Script finished
    echo Script res file saved to %SCRES%.%1 )
    =======================================


    ------------------
    Kosher regards and so on.
    Schizoid
    Kosher regards and so on.
    Schizoid

  7. #7
    Junior Member
    Join Date
    Jul 2002
    Location
    Bangalore, Karnataka, India
    Posts
    19
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to run a Script \"N\" times?

    Hi

    You can't call a testcase inside the testcase

    Convert the testcase into a function then call that function from a testcase 10 times.

    i.e.
    void Test()
    {
    //do anything
    }

    testcase TestTen()
    {
    int i
    for(i=1i<=10;i++)
    {
    Test()
    }
    }


  8. #8
    USB
    USB is offline
    Junior Member
    Join Date
    Dec 2001
    Location
    waltham, MA, USA
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to run a Script \"N\" times?

    You can use Silk plan to run the same tests again and again.
    For example, create test plan file.

    testplan
    Test 1
    testcase: Your Testcase name
    Test 2
    testcase: Your Testcase name
    Test 3
    testcase: Your Testcase name
    ....
    Run the plan file..
    I guess this is the easiest way without writing single line of code in test case file.
    --Seshu

 

 

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 04:06 AM.

Copyright BetaSoft Inc.