Hi Mohit,
that was something we were looking to implement but became slightly unstuck with how it should work, so I'm afraid at present this easily possible, although there is a workaround I can describe.
It was a little while ago that we were looking at this and I've been distracted elsewhere since, I think the stumbling block was around if you were passing a table to a substep would the substep be called once for each row, or would the entire table be passed? If it was iteration, the other potential issue is then how you reference that table inside the substep and in particular how you might reference individual column values.
It sounds like you simply wished to pass the entire table through ?
The workaround is to implement a step which puts the table parameter into the ExecutionContext:
Scenario: someScenario
Given my users are stashed
And the stashed users exist
Define: And the stashed users exist
Sub Step 1
Sub Step 2
@Step("Given my users are stashed")
public void myStepImplementationMethod(final List<Map<String,String>> table) {
ExecutionContext.put(Scope.SCENARIO, "my_users", table);
}
@Step("Sub Step 1")
public void mySubStepImplementationMethod() {
List<Map<String,String>> table = (List<Map<String,String>>)ExecutionContext.get(Scope.SCENARIO, "my_users");
}
I'll agree that this isn't ideal and isn't as neat as it could be. I'll take another look at how we could perhaps implement this.
regards
Ian