Scenario-based testing consists of testing a particular
sequence of operation calls from a Web Service. When you create a scenario-based
test, a single test case is created based on the sequence of operation calls
selected in the wizard.
Before you can create a Web service component test, you must have
access to the Web service definition file (WSDL).
To create a scenario-based test for a HTTP-based Web service:
- Click and
click Next.
This starts the Create
Web Service Component Test wizard.
- On the first wizard page, take one of the following actions:
- Select the test project that will contain the test and click Next.
- Click New to create a new test project.
- On the next page, you select the Web service under test:
- Locate the WSDL definition file for the Web service under test. You can use Browse for a WSDL from your workspace,
or use Import to import the file from the filesystem.
- Select one or more port types to test.
- In the Web service runtime Java proxy generation list,
select the runtime environment (IBM® WebSphere® or Apache Axis) that you
want to use to generate the Java™ proxy for the test.
Note: You
cannot use multiple runtime environments within a single project. If a Web
service component test or stub already exists in the current test project,
you can use only the runtime environment that was previously used in this
test project. To create a test using a different runtime environment, you
must create a new test project.
- Click Next.
- On the "Select a test pattern" page, select the Scenario-based
testing pattern and click Next.
- On the "Define a test scenario" page, create the test scenario
by selecting the port locators and operations that you want to test.
- Add one or more instances of the port by selecting a port locator
from the list and clicking Add. (You can also double-click
a port locator to add it to the scenario.)
- To assign a meaningful name to the port, select the instance
from the test scenario, click Rename, type the new
name, and click OK.
- Double-click each operation to be included in the scenario.
- When you are finished building the scenario, click Finish.
The result is a new test suite along with a test behavior script
and one test case.
The end result is a test behavior script and a test suite with one
test case for the entire scenario.
You can now edit the test behavior script generated from the WSDL
file. Use the test data table to specify input values (server requests) and
expected return values. You can also add, remove, and edit initialization
points and validation actions for the test. Before running the test, make
sure that the Web service under test is running on an application server.