Ask a Question

Setting Count of Test Item from DataSource

SOLVED
siv_arunprakash
Contributor

Setting Count of Test Item from DataSource

Hi,

 

How do I set the Count of the Test Items dynamic?.

 

Project.TestItems.TestItem(1).Count gives me the number of Iteration this test item will run.

 

I need to set the count like Project.TestItems.TestItem(1).Count = 2;

 

I think this is not supported by test complete. Is there any way or workaround to set the count value dynamic from a variable.

 

Please Help.

4 REPLIES 4
tristaanogre
Esteemed Contributor

Currently, there is not.  The best way to do something like this with TestComplete is to set a loop within your test itself and set the upper limit of the loop to be a variable that you can set dynamically.


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

Hi,

 

I have multiple separated Keyword Tests (like login, logout, env setup) and script routines which is grouped under Test Items in the project level.

 

Now how do I set the loop in test level ?. I have multiple Test Items which I need to loop exactly similar to the Count functionality.

 

Sample structure:

          - ProjectName

                  -TestItem1

                         -Setup Env

                         -Login

                         -Logout

                  -TestItem2

                         -Setup Env

                         -Login

                         -Logout

 

Now i need to loop the TestItem1 and TestItem 2 based on the external datasource.

 

Please help.

As mentioned, you cannot.  The "Count" value is read-only at runtime.  To do what you want, you'll need to re-architect the way your tests run so that, rather than being organized as TestItems, you organize them within code to execute within a loop.


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

Hi,

 

You can try using a batch file . Create loop in batch file for the required project (.mds file) and run them . 

cancel
Showing results for 
Search instead for 
Did you mean: