Ask a Question

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

JackSparrow
Frequent Contributor

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 .

 

tescomplete.png

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 5
cunderw
Community Hero

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


Thanks,
Carson

Click the Accept as Solution button if my answer has helped
JackSparrow
Frequent Contributor

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

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 .

 

tescomplete.png

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
Frequent Contributor

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

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.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
cancel
Showing results for 
Search instead for 
Did you mean: