- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Rule Action Execution
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
07-22-2010 11:49 AM
I have a question on how the Rule Actions are executed. In my testcase, I issue a show command to a device. The results depend on several factors, so I need to be able to implement some logic in the pass/fail criteria. Basicly what I have is this:
command - show something
analze - output
assert
when true
- pass test
when false
- Repeat Step max10; delay 10
- Call Procedure goDoSomethingToHelp
- Repeat Step max10; delay 10
- Fail Test
- Declare Execution Issue
When the procedure call to "goDoSomethingToHelp" is actually executed, the Fail Test event has already run. So the test fails, then the procedure is executed which resolves the problem, and then the second Repeat Step is executed and the test generates a pass event.
Shouldn't the test only fail after the second Repeat Step sequence has been exhausted?
Solved! Go to Solution.
Re: Rule Action Execution
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
07-22-2010 12:00 PM
You can do that by moving your "fail" state to an event for that step:
"OnRepeatStepMaxCountExceeded"
This is actually the first available event.
Another option is to put this into conditional logic outside the step, your step sets a variable and using while or for logic, you do your repetitions. I actually recommend this as it makes the test more readable. i.e. all the flow is right there for people to see, in rough psudo code.
eval set found 0
for (i=0->10) command.show something
assert: value = expected
when true
eval set found 1
break
when false
nothing
call proc_to_help
eval get found
assert: found==1
when true
pass test
when false
fail test
Does this post answer your question? Click the "Accept as solution" button.
Was this post helpful? Click the yellow "Kudos!" button.
Re: Rule Action Execution
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
07-22-2010 12:08 PM - last edited on 07-22-2010 12:09 PM
So is my assumption that the Rule Actions are executed in order false?
I'll probably redo my test so the conditional logic is outside of a single step, but I want to make sure I understand the Rule Action processing.
Re: Rule Action Execution
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
07-22-2010 01:06 PM
They are executed in order, but they are ALL executed, and actions like call and repeatStep are queued up to execute after all events have been processed. These deferred actions are then executed in the order they were deferred in.
-a
Does this post answer your question? Click the "Accept as solution" button.
Was this post helpful? Click the yellow "Kudos!" button.
