Getting Started with Functional Testing
Now that you have imported some WSDL's and tries some requests its time to create your first TestCase. In soapUI,
functional testing can be used to validate required functionality both for each web service invocation on its own
(="unit testing") or for a number of requests sequence (="integration testing"). Further, you can add scripts (using
the Groovy Language) that can enhance your tests in any way
you want, for example interact with a database or perform complex test-flow logic.
There is a commercial version of soapUI available; soapUI Pro.
soapUI Pro makes the XPath Assertion much easier by using the XPath Selector.
soapUI Pro contains productivity enhancements as well as offers Professional World Class support.
We will continue where we left off in the first "Getting Started" document where we just had created a project
and imported the Amazon Web Service. The next step is to create a TestSuite/TestCase and add some TestSteps:
Create a Web Service Test from SOAP request
Once you have some requests working as you want, you can create a TestCase that verifies their behavior
- Select the second toolbar button in the request editor window ("Add this request to a test-case").
- If there are no TestSuites or TestCases in your project, soapUI will prompt you for names of these,
start out by specifying something like "Amazon TestSuite" and "Amazon TestCase"
- soapUI will prompt you for the name of your test request, call it "Step 1"
- Corresponding TestSuite/TestCase will be created and the request will be added as a Test-Request
which is a copy of the original request (so you can keep playing with that without changing the test request)
- A test-request-editor almost identical to the previous request-editor will be opened with your new test
request; it differs by adding assertions functionality
Read more about TestSuites/TestCases in the soapUI User Guide |  |
Add an Assertions to a test
Now that you have your first test request you should add some assertions to verify that it works correctly
- Select the second toolbar button in the request editor window ("Add an assertion to this test request").
- Start by adding a "Schema Compliance" assertion, this will check that the response is compliant with the
associated WSDL/Schema definition. The assertion will be shown in the assertion list under the request/response
editors (see image below)
- Post the request with the green submit-button, soapUI will run the request and validate the response. If all goes
well the test-request should be shown with a green background in the navigation tree
Read more about assertions in the soapUI User Guide |  |

Now run your web service test!
Once you have all the test request and their assertions you want you can run the entire TestCase
- Double click on the test case node in the left navigation pane, this will open the test-case runner.
- Run all tests by selecting the green arrow button labeled "Run this TestCase", soapUI will
submit each test request and validate accordingly, the results will be displayed during the execution.
Run your tests from the command line using one of the
soapUI command line tools available. |  |
Next:
Web Service TestSuites