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.

  1. Right-click the root test suite node Test Suite: Functional Tests and select Add New> Data Source from the shortcut menu.
  2. Select Excel from the New Project Data Source wizard and click Finish.

  3. In the Data Source configuration panel, complete the following:
    1. Enter Books in the Name field.
    2. Click the File System button to navigate to and select the Books.xls file that is included in the SOAtest examples/datasources directory.
    3. Click Save.
    4. Click the Show Columns button to display the column names from the Excel Spreadsheet.

  4. In the Test Case Explorer, double-click the Test 1: getItemByTitle node from the previous exercise.
  5. 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.

  6. 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.

  7. 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.
  8. Right-click the Response SOAP Envelope> XML Assertor node and select Delete from the shortcut menu.
  9. Right-click the Test 1: getItemByTitle node and select Create/Update Regression Control.
  10. In the Response Validation wizard, expand Update Regression Controls, select Update All Controls, and click Finish.

  11. 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.
  12. 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.

  • No labels