Coverage Settings (SOAP Virtual Services)

Applies to ReadyAPI 3.51, last modified on March 21, 2024

About Coverage Testing

Every SOAP virtual service has a WSDL specification that defines requests and responses the service supports. You can command a virtual service to analyze incoming requests and outgoing responses and to detect what requests and responses were covered during the service run. This helps you estimate how well your virtual service and your tests cover the WSDL specification of your web service.

You enable the coverage check for your SOAP virtual service and view coverage results on the Coverage page of the SOAP service editor. The page is available only for SOAP virtual services.

Besides service coverage, in ReadyAPI, you can also evaluate coverage for individual messages. You can do this on other pages of the virtual service editor. See below for details.

Enable Virtual Service Coverage

  1. By default, the coverage check is disabled. To enable it, select the Enable Coverage check box on the Coverage page. You can select the check box before or during the service run:

    Coverage testing of virtual APIs: Enabling coverage check for virtual service

    Click the image to enlarge it.

  2. After you selected the check box, start your virtual service from within ReadyAPI (if it is not running yet) and simulate requests. The service will collect coverage statistics for incoming requests and outgoing messages: it will check the contents of requests and responses and will detect what XML elements and attributes they use (SOAP passes data in the XML format). Request and response bodies can have complex data structures with multiple elements on each level. The service will check elements on all levels.

    You can see results of the check on the Coverage page (see below). To clear accumulated data, press .

Coverage Results

The Coverage page displays a tree-like structure of operations defined in your specifications and a tree-like structure of virtual operations in your service:

Coverage testing of virtual APIs: Coverage results of a SOAP virtual service

Click the image to enlarge it.

Virtual Operation Results

To view coverage results of virtual operations, expand the node that corresponds to your virtual service:

Coverage testing of virtual APIs: Coverage results of a SOAP virtual service

Each operation node has child nodes that correspond to an individual message pair (request-response). The page uses green for covered elements and red for uncovered:

Coverage testing of virtual web services: Color coding
Note: The green color indicates covered requests and responses. It does not mean a request passed successfully.

The numbers indicate the number of checked XML elements in a request (or response). For example, in the picture below, 3/4 means the WSDL spec defines 4 elements in a response body (including the parent element), and the response covered only 3 of them. In other words, one element was not specified in the request body:

Coverage testing of virtual web services: Result data

If at least one child element is covered, its parent element is also treated as covered. The page also displays a percent of covered elements (the value in parenthesis is not used).

The numbers of parent nodes in the tree are sums of their respective child values:

Coverage testing of virtual services: Merged values

To see what part of the WSDL specification a request or response covers, select this request or response in the tree and switch to the Message Coverage page on the right. If the page caption is not visible, hide the editor that you may have opened on the right of the ReadyAPI window:

Coverage testing of virtual services: Viewing request and response contents

Click the image to enlarge it.

To view the contents of a request or response, select that request or response in the tree and switch to the Message Content page on the right:

Coverage testing of virtual services: Viewing request and response coverage

Click the image to enlarge it.

WSDL Coverage Results

The tree nodes under your WSDL spec node display summary coverage results for messages defined in your WSDL:

Coverage testing of virtual APIs: WSDL specification coverage

Click the image to enlarge it.

Each message node has two or three child nodes: Request, Response, and Fault (if defined in WSDL). The result of each node is a merge of coverage results of virtual operations that your virtual service simulated. For example, in the image below, 1/2 means that the WSDL spec defines two XML elements for a response body, and your service covered only one of these elements (that is, all the virtual operations of your service that simulate that response covered only one of the elements):

Coverage testing of virtual APIs: WSDL spec coverage results

To view the exact portion of your WSDL some request or response covers, select this request or response node in the tree (or select its child Body node) and switch to the Message Coverage page on the right:

Coverage testing of virtual APIs: WSDL operation coverage

Click the image to enlarge it.

As usual, the green color indicates covered elements, and the red color indicates uncovered elements.

Coverage Options

ReadyAPI includes a number of options that let you adjust the coverage process. To view or change them, click on the toolbar. In the subsequent dialog, you can specify how ReadyAPI should treat empty elements or elements with the question mark placeholders, what elements it will skip during the check, and how it will calculate coverage based on the element values:

Coverage testing of virtual web services: Opening the Coverage Options dialog

Click the image to enlarge it.

For more information on the settings, see the description of the Coverage Options dialog.

More Coverage Results

The Coverage page displays results of the coverage check for the entire virtual service. You can view coverage results for requests and responses on other pages of the virtual service editor.

Setup Page
  1. On the Setup page of the virtual service editor, select the desired response. This will display the response editor on the right.

  2. In the editor on the right, select the Coverage > Enable Message Coverage check box.

    You will see what portion of the WSDL response specification the response data covers (green indicates covered elements, red – uncovered):

    Coverage testing of virtual APIs: Message coverage on the Setup page

    Click the image to enlarge it.

To perform this check, you neither need to run the service, nor to select the Enable Coverage check box on the Coverage page of the virtual service editor.

Transaction Log

In the Transaction Log, you can easily check what portion of the WSDL specification the simulated requests and responses covered:

  1. On the Transaction Log page, select a request or response. This will open the request or response log on the right.

  2. In the log on the right, select the Coverage > Enable Message Coverage check box:

    Coverage testing of virtual APIs: Message coverage in the Transaction Log

    Click the image to enlarge it.

To view this data, you do not need to select the Enable Coverage check box on the Coverage page of the virtual service editor.

See Also

Configuring Virtual Services
SOAP Coverage Testing
Coverage Options (SOAP Testing)

Highlight search results