Show TOC

Testing a Web Service OperationLocate this document in the navigation structure

Prerequisites

You have selected the Web service that you want to test.

Context

The Web service chosen for testing can contain many operations. Web Services Navigator (WS Navigator) allows you to select the operation you want to test. You can enter or load test data for the input parameters of the selected operation.

Procedure

  1. Choose the Operation step on the Service Test tab page.
  2. Choose the operation you want to test from the list in the Operations screen area.
    Note

    You can test the selected operation without entering test data manually. To do this, choose the Result step in the navigation area. This way WS Navigator uses the default values for the operation input parameters.

  3. Choose Next to proceed to the Input Parameters step.
  4. Review the input parameters:
    • When the selected operation has input parameters, they appear as a tree structure in the Parameters screen area. WS Navigator displays an asterisk sign next to the required parameters and provides a field for entering values for them. By default, the optional elements are skipped.

    • When there is documentation available for an input parameter, you can access it using the corresponding link displayed to the right of the parameter.

    • To collapse or expand the whole structure, use the buttons at the right end of the toolbar in the top part of the Parameters screen area.

    • To show or hide separate elements of the tree structure, expand or collapse the corresponding tree branch.

  5. If you want to enter or modify the test data for the input parameters manually, you can do one or more of the following:
    • If you want to enter a value for an optional parameter you should deselect the corresponding Skip checkbox.

    • If you do not need to provide values for all parameters in a structure branch you can select the Skip checkbox for the root element of the branch.

    • To edit all input parameters, choose Start of the navigation path Edit Next navigation step Unskip All End of the navigation path.

    • To display only the required input parameters, choose Start of the navigation path Edit Next navigation step Reset End of the navigation path.

    • To test the operation without entering test data manually, choose Start of the navigation path Edit Next navigation step Skip All End of the navigation path.

      Thus WS Navigator uses the default values for the operation input parameters

    • You can copy and paste the entered data between elements by choosing corresponding option from the Change menu.

      You can do this for individual elements, for a branch in the tree structure, and for the entire structure.

    • To find a particular value entered for an input parameter, choose Find on the right end of the toolbar and use the forms and buttons that appear below the toolbar.

      You can also replace some or all of the found values with another value. Note that the search functionality is not case sensitive, and you cannot use search wildcards.

    Note

    If you plan to repeat the test with the same or similar test data set, you can save the test data you have currently entered. To do this, choose the Export button in the toolbar and select the folder in which the XML file with the test data should be saved. You can later use the saved file with the Start of the navigation path Import Next navigation step Test Data End of the navigation path option described below.

  6. If you want to load the test data from a file you can do one of the following:
    • To import a test data file saved from a previous test of the operation, choose Start of the navigation path Import Next navigation step Test Data End of the navigation path.

    • To import test data from an existing test scenario file, choose Start of the navigation path Import Next navigation step Test Scenario End of the navigation path.

      You can specify a scenario test data file that contains test data both for the currently selected operation and for other Web services and operations. The importing tool selects only the test data for the currently tested Web service interface and operation. When the scenario file contains two or more sections with test data for the selected operation, the importing tool selects the test data in the first section from the beginning of the file. More information: Using Test Scenarios

    Note

    During the import, WS Navigator verifies the test data and imports only the matching parameters. Thus you can reuse the available test data sets. This is useful, for example, when you test Web services with similar interfaces, or when you test a Web service that is still in development.

  7. Choose Next .

    If the service requires authentication you may need to provide a user name and password.

Results

The system sends the test data to the Web service. On successful completion of the test you can compare the test data and the results, save the test data for later usage, or add the current test to a test scenario.