Forum Discussion

JackSparrow's avatar
JackSparrow
Frequent Contributor
8 years ago

Controling the Iteration of Test Case based on the Count given in Test Items

Hi All,

 

In Test Items we can add our Testcases and run it at once. Now, can we control each iteration of the test case from test items Count Column based on the value we give .

 

For example : From the above picture for the test case ProjectTestItem1 i have given " for loop iteration " based on, the count of data i have given, now instead of depending on the count of data given every time.

 

I will give some 100 data for the test case ProjectTestItem1 but  i just want to execute the  only 10 iteration by taking 10 data from the given data of 100  now that count of 10 can be given in the Count Column in the above picture. So that it will execute 10 iterations by taking 10 data of given 100 data.

 

if i execute again it must use the next set of data from the remaining 90 based on the number given in Count Column.

 

 

5 Replies

  • cunderw's avatar
    cunderw
    Community Hero

    You could use a persistent variable that increments and the new value will remain for the next run. 

    • JackSparrow's avatar
      JackSparrow
      Frequent Contributor

      cunderwSorry i didn't understood , can you please elaborate , it will be very helpful

  • mgroen2's avatar
    mgroen2
    Super Contributor

    JackSparrow wrote:

    Hi All,

     

    In Test Items we can add our Testcases and run it at once. Now, can we control each iteration of the test case from test items Count Column based on the value we give .

     

    For example : From the above picture for the test case ProjectTestItem1 i have given " for loop iteration " based on, the count of data i have given, now instead of depending on the count of data given every time.

     

    I will give some 100 data for the test case ProjectTestItem1 but  i just want to execute the  only 10 iteration by taking 10 data from the given data of 100  now that count of 10 can be given in the Count Column in the above picture. So that it will execute 10 iterations by taking 10 data of given 100 data.

     

    if i execute again it must use the next set of data from the remaining 90 based on the number given in Count Column.

     

     


    JackSparrow I think your case relates to this feature request, I have created some time ago...  Please take a look at it and vote for it if you like.

    • JackSparrow's avatar
      JackSparrow
      Frequent Contributor

      mgroen2Thanks for the info but that is Keyword Testing , can i use the same feature in the Scripts

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        As cunderw mentioned, your best bet is to declare a persistent variable on your project and store information in there at the end of your test run to indicate where it last stopped.  Then, use a for loop with that value as your starting value and that value plus your TestItem.Count value to loop through your records.  Given a bit, I can mock something up for you... mind you, it would be in JavaScript but hopefully these hints will get you started.