12-21-2017 08:44 PM
In my sequence of TS2016, there's a if...else if...else if...series flow.
but each time the last else if step was skipped even the else if condition is true.
I switch the last "else if" with previous "else if", the new last one still skipped.
anyone can tell why?
Solved! Go to Solution.
12-21-2017 09:28 PM
The reason maybe my misunderstanding for else if, I should use just if end is OK.
12-22-2017 02:43 AM
12-22-2017 03:32 AM
Johnnny, It has been a while since I looked at TestStand If/Else If/Else steps, but my recollection is that TestStand will only skip over an Else If when the If Condition for a previous If or Else If has evaluated to TRUE. If none of the If Conditions evaluate to TRUE then the status for all of the If and Else If steps should be Done.
I couldn't resist it I had to check, so here are a few screen shots.
First if none of the If Conditions evaluate to TRUE (I set Locals.If to 0). NOTE: The Status for all Ifs and Else If is "Done".
Then if the If Condition of the If step evaluates to TRUE (I set Locals.If to 1)
Then it the If Condition of one of the Else If steps evaluates to TRUE (I set Locals.If to 2)
If you could expand your screen capture to include the Description (to show your If Conditions) and Status (to show how the execution ran) columns, it would be a big help.
Steve
12-24-2017 09:01 PM
Thanks Steve~
With your sequence, I find out what i'm wrong.
not all the condition of my flow are relatives, so some of the else if are skipped when previous steps are evaluated.
Now I replace the non-relative steps with single if, it works now!