It is useful to test situations where invalid data is sent to your service, for example, sending a string when your service expects an integer.

  1. Select the Test Suite: Functional Tests node, then click the Add Test Suite toolbar button.
  2. Choose Empty from the Add Test Suite wizard and click Finish.
  3. Double-click the new Test Suite: Test Suite node that was added to the test suite tree.
  4. Name the test suite Sending Bad Data and click the Save toolbar button.
  5. Expand Test Suite: getItemById Unit Tests > Test Suite: getItemByIdNegative Test and copy Test 1: getItemById.

  6. Paste Test 1: getItemById into the new Sending Bad Data test suite.
  7. Double-click the Test 1: getItemById node within the Sending Bad Data test suite.
  8. In the test configuration panel’s Form Input view, right-click the id element and disable (uncheck) Enforce Schema Type in the shortcut menu. This allows SOAtest to send the id element data that does not conform to the schema. In this case, the schema indicates that the id element is an int, but we'll send a string instead.
  9. Enter the literal string Bad Data as the Fixed Value for the id element, then click the Save toolbar button.
  10. Click the Run Tests toolbar button.
  11. After the test completes, view the traffic by expanding the Test Suite: Sending Bad Data > Test 1: getItembyID branch and double-clicking Traffic Object > Traffic Viewer.
  12. Click the Traffic Viewer’s Response tab and notice that an exception is thrown and displayed in the Response traffic.
  13. Right-click the Test 1: getItemById node within the Sending Bad Data test suite and choose Create/Update Regression Control.
  14. In the Response Validation Wizard, choose Create Regression Control and click Finish.
  • No labels