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
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:
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 .
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:
Virtual Operation Results
To view coverage results of virtual operations, expand the node that corresponds to your 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:
|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:
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:
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:
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:
WSDL Coverage Results
The tree nodes under your WSDL spec node display summary coverage results for messages defined in your WSDL:
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):
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:
As usual, the green color indicates covered elements, and the red color indicates uncovered elements.
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:
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.
On the Setup page of the virtual service editor, select the desired response. This will display the response editor on the right.
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):
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.
In the Transaction Log, you can easily check what portion of the WSDL specification the simulated requests and responses covered:
On the Transaction Log page, select a request or response. This will open the request or response log on the right.
In the log on the right, select the Coverage > Enable Message Coverage check box:
To view this data, you do not need to select the Enable Coverage check box on the Coverage page of the virtual service editor.