Using the Module Communicate with Web service

As of Tricentis Tosca 12.2, the Webservice Engine 3.0 is no longer supported. By default, you cannot create WSE TestCases in API Scan.

For information on how to re-enable scanning WSE TestCases in API Scan, see chapter "Web service".

This chapter uses an example to demonstrate how the Module Communicate with Web service is used. All specializations are selected manually and all values are entered manually.

Specialization Modules can be specified in the respective TestStep. Use the Modules contained in the TBox package or custom Modules as Specialization Modules. For further information on Specialization Modules, please refer to chapter "Selecting specializations in the TestCase".

If a specialization is to be selected for an XTestStepValue which has not yet been generated, then this XTestStepValue must be generated by selecting the option Create XTestStepValue from the context menu.

Procedure

  1. Create a TestCase and drag the Module Communicate with Web service onto the TestCase.

  2. Select Request and the option Implement Specialization from the context menu.

  3. The subsequent dialog Select Specialization Module shows all available Specialization Modules. Select the required Module and confirm your selection by clicking the OK button.

  4. Add the required data for the Specialization Module.

    If your message is either a JSON or XML format, you can paste the values from the clipboard. Copy the entire JSON or XML structure which reflects the used module. Right click onto the XTestStepValue Request and select WebServiceEngine -> Paste from clipboard from the context menu.

  5. Select the TestStepValue Communicate. After that, select the option Implement Specialization from the context menu and select the required Specialization Module. If REST is used, the Module Rest over HTTP must be selected. Add the information that is required to communicate with the server.

    The following attributes must be filled with values: Address, Method and Content-Type.

    If SOAP 1.1 is used, the attribute SOAP Action must contain a value.

    If SOAP 1.2 is used, the attribute SOAP Action does not exist. The SOAP action is specified in the TestStepValue Content-Type.

    The attribute Receive requires the ActionMode Select.

    Detailed information about the communication with JMS providers is provided in chapter "Sending and receiving messages via JMS"

  6. Now repeat the same procedure for the attribute Response .

IPv6 addresses can be used in the TestStepValue Address. These must be specified in square brackets, for instance, http://[<IPv6-Address>]:8080/CalculatorService.

If the TestStepValue Status code name should be used to verify a status code which is not available from the drop-down menu, the number of the corresponding status code must be specified.

The XModule, which has been scanned for the request, is selected as a Specialization Module in the TestStepValue Request. This Module is used to send the numbers 2 and 3 to a Webservice where they are added up, and the result is returned as the Response.

Example of TestStepValue Request

In the TestStepValue Communicate, the duplicate of the Module SOAP over HTTP, which has been created via XScan, is selected as a Specialization Module.

The attributes Address, Method, Content-Type and SOAPAction already contain values. The TestStepValue SOAPAction only exists if SOAP 1.1 is used.

The TestStepValue Receiveis used to verify whether the returned Status code contains the value 200.

In the TestStepValue ProtocolVersion, the HTTP version 1.1 is specified.

Example of TestStepValue Communicate

In the Responsesection, the engine verifies whether the result the Webservice returns is correct. In this case, the total sum must equal 5.

Example of TestStepValue Response