Getting Started
Below you'll find a step-by-step guide to creating your first soapui project with som requests and a testcase. The
sample will use the amazon.com web-service
Although soapui should be easy to get started with, you will need to have a good grasp of the following
concepts/technologies to get the most out of soapui's functionality.
- WSDL - basic concepts (services, ports, bindings, porttypes), relation to xml-schema
- SOAP - basic concepts, relation to WSDL (bindings, etc), different encoding types (soap-encoded/literal) and
message styles (document/rpc)
- XML and related technologies - XPath, XML Schema, namespaces, etc
You can find most specifications at W3C and tutorials
at several sites, for example W3Schools and
zvon.org.
Install/Run soapui
Begin by either launching the latest version with Java WebStart
or downloading the
latest release from sourceforge and running it manually and running the included run.bat/run.sh script (you
will need java/java.exe in your path). In either case, soapui should start and display an empty workspace to
get started with.
Create/Import a project
Now that you're up and running, get going by creating your first project.
- Right click on the workspace node in the left navigation pane and select "New WSDL Project"
- You will be prompted for a project name and then for a local file where the project should be saved
- If all is ok an empty project will be created in the workspace
If you have downloaded the offline version, a sample project is included in the root folder; select
"Import Project" instead and browse to the sample-soapui-project.xml file.
Read more about projects in the User Guide
| 
|
Add a webservice to the project
Now that you have a project you can start adding Interfaces (=WebService PortTypes) to it.
- Right click on the project node and select "Add WSDL from URL"
- You will be prompted for the url to the Interfaces WSDL; enter http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl
to add the amazon web service and select "Ok".
- soapui will prompt you if you want to create default requests for each operation, simply select "Yes"
- soapui will now add the SOAP/Http Binding for the amazon "AWSECommerceServicePortType" PortType to your project
and create nodes for each operation.
Read more about interfaces in the User Guide
| 
|
Try some requests
Now that you have added the amazon webservice you can start playing around with some requests.
When you added the interface in the previous step soapui created default requests for each operation in
accordance with their WSDL/Schema definition.
- Expand the Interface node and any Operation node under it, you should see the created "Request 1".
- Double-click the request node to open the request editor in the right part of soapui
- The request editor is divided into 3 parts:
- A toolbar at the top with a number of request-related actions/options
- A request area to the left
- A response area to the right
- The default request created by soapui will have "?" for each value that needs to be supplied in the request,
replace/remove any values as required and post request by pressing the left-most toolbar button (a green arrow)
- The request will run in the background and its response will be displayed in the right editor
Read more about working with requests in the User Guide
| 
|
Create a TestCase from some request
Once you have some requests working as you want, you can create a testcase that verifies their behaviour
- Select the second toolbar button in the request editor window ("Add this request to a test-case").
- If there are no testsuites/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/testcases 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 User Guide
| 
|
Add Assertions
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.
- 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 User Guide
| 
|
Run your 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.
| 
|