Create an Scenario for a Decision Table in FitNesse

1.6k Views Asked by At

I am trying to create an scenario before executing a decision table on FitNesse, but I am not able to make it work. Doing it with an script table looks easy, but I can't find any example doing it with a decision table.

What I want is to execute the scenario script just before checking the decision table. My code looks like this:

--Here the Scenario

!|Scenario|ScenarioTest|
|AddSomeData|1|
|AddSomeData|2|

--Here the decision table

!| TestingScenarios.DecisionTable       |
|Parameter1|Parameter2|Result1?|Result2?|
|1         |2         |3       |4       |
|3         |4         |5       |6       |
1

There are 1 best solutions below

0
On

A scenario is just a definition of a sequence of steps (so you can use these multiple times without having to repeat all the steps each time).

If you just want to execute the steps once, before the decision table, put a script table on the page before the decision table.

If you want to execute the steps for each row in the decision table see 'Invoking a scenario from a Decision Table' on http://fitnesse.org/FitNesse.UserGuide.WritingAcceptanceTests.SliM.ScenarioTable