Now as per the sample code given in ACT, a file is maintained to save the records for "Post" and in Do While loop data is fetched one by one and posted.
But if we place loop in Main function then the count of iteration will not be correct. So i can't implement it by loop.
Please tell me know how i can implement it. Your response will be of great help.
Thanks in anticipation
If I understand your question and what you're looking for is a variable that is common across all threads of the test, that you can use to iterate runs, you may wish to use a global variable. Here's a sample.
It's covered in more detail in the ACT docs, but simply put there is a global variable area within the test object so that you can have data shared. It works pretty well, though in my case I also added a function that staggers my users (ACT has to out of box functionality for that) so that no one runs this code at the same time.
Yesterday I got same property n the ACT doc, but I had one query. But we need to initialise the "mycounter" variable and I couldn't get the way how to do it so that it is not repeated in other iteration than 1st.
Please do let me know.
I guess I don't quite follow.
The variable is already "initialized". It's really a multi-dimensional array that ACT sets up for global variables. One position for the field name, then the value. When you call getglobalvariable for the first time, it creates an entry in the array, with a value of "". Any future calls to that global use the exact same memory space. So the only think you'd need is an IF to make sure you're not trying to pull a numeric value from it if it's null.
If that doesn't clear it up, you can give me a brief example as to what you're using this for specifically, and I'll try to be more specific.
In my case, I use it for server-balancing and for when I need to have 6/10ths (as an example) of my iterations do a specific action, and I need more mathmatical reproduceability than using a random number.