Action Parameters define the interface of an Action to the rest of the system. Parameters define the input information that the Action expects the Scenario to provide and the output information that the Action returns from its logic.
While building logic in Action, you need to furnish information for various statements, to enter into the test application or the API calls. This information can either be fixed in the action logic itself or expect the Scenario to pass ("caller" of the Action). Passing this information from Scenario makes the Action flexible to work with different inputs as decided by different Scenarios (test cases). You define an Action Parameter when you need the Action to be exercised with different input values.
For example, if you have an Action to search for flights, you would need to provide Origin, Destination, Travel Dates, Class of Service etc. These can be defined as Action Parameters so that each test case (from Scenario) can pass different values for these.
Action input parameters enable data driven testing. Same Scenario may be run with multiple "sets" of data for the action parameters, with each set forming a test case.
Remember following points about Action Parameters:
- Used when the information may be required to be changed every time an Action is used in a Scenario
- Promotes Data Driven Testing
- Values are set in the “Test Cases” belonging to the Scenario where the Action is used as a step
- Allows Data Type and Data List to specify permissible values