Unit Testing a Component in a Flow
As part of the flow development, test data needs to be provided for a component in a flow. After the test data is added, a component may have to be unit tested to make sure that the provided test data gets the flow working as expected.
To unit test a component that is part of a flow:
- Navigate to the Flows tab.
- Select and right-click the flow. Click Create/Update Flow Structure.
- On the Flow Definition page, navigate to the component. Right-click and select Edit Test Data.
Alternatively, you can click the edit icon next to the component in the flow.
- On the Edit Test Data page, provide the web service name in the component's test data. Also, provide the operation name/transaction type in the appropriate component's test data field. Fill up all the test data for the component as necessary.
- Save the test data and click Close.
- On the Flow Definition page, click the Test Component icon
next to the component name. Alternatively, you can right-click the component and select Test Component.
This will open up the conversational test data entry screen for the component.
- Select the flow and user configuration needed to test the component. Click OK.
- Click Send to post the request to the application being tested. Clicking Send does not save the data into the test data of the component being tested.
- After receiving the response, validate it (for errors) to see if the test data provided is appropriate. Else, adjust the test data and click Send to send a new request to the application being tested.
- Repeat step 9 till the expected response is obtained.
- Once the appropriate test data is set and the response is as expected, click Save to save the updated test data into the component's test data in the flow.
Note:
Clicking Save will only replace any static values provided in the component's test data for a given element. If the Test Data field for a component line contains a global variable, the variable in the field will not be replaced by the static data in the request being saved.