12-22-2017 12:05 AM
Hi,
Thanks in advance. I have a sequence file with multiple operations and i want to count a particular step which is executed in that sequence.
Find the attached image below, there is a step highlighted in the sequence want to count that particular step (Like how many times it has been executed)?
Solved! Go to Solution.
12-22-2017 02:48 AM
Hi,
I assume you're going to be looping your sequence based on a condition and this is why you want to count it?
The easiest implementation would be to use a post expression to increment a variable every time it runs (Locals.Count++).
You can then output this in any method you like.
Nico
01-02-2018 02:54 AM
Hi Nico,
Thanks for the reply for each step i can't able to add post expression like you said. I am expecting to count a test action step in sequence. Like how many times this particular step had run.
01-03-2018 04:36 AM
From the information posted it sounds to me that the solution suggested by Nico is the way to go. Diana_Mary can you give us some more information why Nico's solution doesn't work for you? I notice that the steps in your sequence already all have Post Expressions assigned, are you aware that you can have multiple expressions in a single Post Expression by separating them with commas?
Locals.Var1++, Locals.Var2 = Locals.Var1 + Locals.Var3
01-04-2018 12:07 AM
Hi SercoSteveB,
Please find the attached file. In that file i have been highlighted the write and read action steps within the loop. Example that loop is running for 10 times, which the action steps has been run multiple times within the loop. So i want to count how many times the write and read steps are executed within that loop i.e., Like a counter says result is 20 times.
there is no post expression in this steps. Kindly forgive me that i have not quoted clear example.
Thanks,
Diana Mary.
01-04-2018 03:19 AM
Hi Diana Mary. Looking at your screen shot it looks like both the Read and Write steps will always be run exactly 10 times each as the only exit criteria specified within your FOR Loop definition is when Locals.Count >= 10.
Assuming you have other FOR Loop exit criteria that are not included in your example, I would still go with what Nico011 suggested.
These are the steps I would follow to configure the sequence to record the number of times either the Read or Write action was run.
At any point in your loop (and after) Locals.ReadWriteCount will contain the number of times either the Read or Write Action steps was run.
I am conscious that I am giving you the same answer as before. Apologies if I have missed something (again). If I have missed something may I suggest you describe why the Post Expression based solution will not work for you.
01-04-2018 03:42 AM
I created a sequence (.seq attached TS2014), here is a screen capture.
01-04-2018 04:37 AM
Hi SercoSteve,
Thanks a lot. I am using Teststand 2013 so please can you degrade and send me the file. Also need separate count for write and read steps.
Thanks,
Diana Mary.
01-04-2018 04:45 AM
Modified for individual tracking of Read and Write actions. TS2013 version attached.