Now that we have a unit test created that tests a single input value, the next step is to add a data source. Adding a data source will allow you to test multiple input values with a single test case.
- Right-click the root test suite node Test Suite: Functional Tests and select Add New> Data Source from the shortcut menu.
- Select Excel from the New Project Data Source wizard and click Finish.
- In the Data Source configuration panel, complete the following:
- Enter
Books
in the Name field. - Click the File System button to navigate to and select the
Books.xls
file that is included in the SOAtest examples/datasources directory. - Click Save.
- Click the Show Columns button to display the column names from the Excel Spreadsheet.
- In the Test Case Explorer, double-click the Test 1: getItemByTitle node from the previous exercise.
- Click the Request tab and Books should already be selected from the Data Source drop-down menu that is now present in the test configuration panel.
- From the titleKeyword drop-down menus at the bottom of the tool configuration panel, select Parameterized and Keywords and then click the Save toolbar button.
- Click the Test tool bar button and notice the error messages that appear in the Quality Tasks view. The test ran one time for each row in the Keywords column, but failed due to the XML Assertor we created previously. Now we need to update our regression control.
- Right-click the Response SOAP Envelope> XML Assertor node and select Delete from the shortcut menu.
- Right-click the Test 1: getItemByTitle node and select Create/Update Regression Control.
- In the Response Validation wizard, expand Update Regression Controls, select Update All Controls, and click Finish.
- Select the Test 1: getItemByTitle node and click the Test toolbar button. SOAtest adds new regression controls for each test run. In this case, 4 regression controls are added: one for each data source row.
- Double-click the Traffic Object> Traffic Viewer node beneath the Test 1: getItemByTitle node and notice that the test ran four times: once for each keyword value in the Keyword column.