Importing Webservice TestCases from SoapUI

Tosca Commander allows you to import existing SoapUI projects.

The SoapUI project import creates Webservice TestCases, the corresponding Modules, and an ExecutionList in a new Component Folder. Furthermore, TestCase-Design TestSheets, TestCase Templates, and Instances can be created automatically. For further information on supported SoapUI versions, refer to the System Requirements.

Importing SoapUI projects

Follow the steps below to import your SoapUI project into Tosca Commander:

  1. Click on the project root element or on a Component Folder.

  2. In the Tosca Commander main menu, switch to the Tools tab and click on SoapUI Project to open the Import SoapUI Project window.

Import SoapUI Project window

  1. Click on next to the input field and select the SoapUI project file that you want to import from the subsequent dialog box.

  2. To change the following import options, click the icon to expand the Options section.

    If the option Use Test Case Design is active, the SoapUI Project Import automatically creates TestCase-Design TestSheets, TestCase Templates and Instances. Tosca combines SoapUI TestCases of the same operations into a TestCase-Design TestSheet.

    If the option Filter Business Relevant Value is active, the SoapUI Project Import generates all attributes which have different values in the Instances of the generated TestSheets. Attributes of the same values will be imported as constant values into the TestCase Template.

  3. Click on Start Import to start importing a SoapUI project.

  4. The SoapUI Import Result window shows the import results.

    The SoapUI Details section shows the cumulated number of objects of the SoapUI project. Objects highlighted in green are successfully imported. Objects in red could not be imported. The Tosca Import Details section lists all objects that have been newly created in Tosca Commander.

Import SoapUI Project window

Expand the Details section with the icon in order to view a detailed result list, or hit Open Report to open the list in a text file.

The following icons show the state of each element in the SoapUI Import Result list:

Icon

Description

This icon indicates the successful import of an object and all its subordinate objects.

This icon marks an object with at least one subordinate object where an error occurred during the import.

This icon indicates an error during the import of an object.

This icon indicates a warning for an object which was partially imported.

You can filter the result via the drop-down menu to show either successfully imported elements, errors or warnings.

Use the key combinations Ctrl + + and Ctrl + - to expand or collapse all elements of the selected node.

  1. Close the SoapUI Import Results window by clicking on the Close button.

    The project is imported into a new component folder and it keeps its SoapUI structure.

    The SoapUI import needs specific Modules of the default subset, which are automatically imported from the default project directory of the Standard subset (see chapter "Use the Standard subset").

Project structure in Tosca Commander - SoapUI

Structure of an imported SoapUI Project

The structure of the created TestCases matches the structure of the SoapUI project. The supported SoapUI objects and their implementation in Tosca Commander are explained below.

SoapUI TestStep SOAP Request

For each SoapUI TestStep of the type SOAP Request, Tosca creates a TestStep with the prefix Send for communication and a TestStep with the prefix Verify that verifies the response.

Tosca Commander supports the SoapUI Assertions Contains, XPath Match and Valid HTTP Status Codes as follows:

The TestStep used to communicate with the Webservice is based on the standard Module Communicate with Web service. This TestStep contains the request, transport information, and it saves the response to an XML resource. The SoapUI Assertion used to verify the status code is imported into the TestStepValue Communicate->Receive if necessary.

The verification TestStep is based on the standard Module Verify XML which allows XML resources to be verified. Tosca will import the SoapUI Assertions Contains and XPath along with any wildcards into this TestStep.

The dynamic expression CONTAINS allows for the SoapUI options Ignore Case and Regular Expression for the SoapUI Assertion Contains. If both options are activated in the SoapUI project, the regular expression will be interpreted. For further information on how to use CONTAINS, please see also chapter "How to verify strings by using the dynamic expression CONTAINS".

The standard Module Verify XML supports the SoapUI option Allow Wildcards for results that include strings for the SoapUI Assertion XPath. The dynamic expression XMLDIFF allows XML documents to be verified using the options Ignore namespace prefixes and Ignore XML Comments. For further information on how to use XMLDIFF, please see also chapter "How to verify an XML resource by using the dynamic expression XMLDIFF".

SoapUI TestStep Delay

SoapUI TestSteps of the Delay type are created automatically with the standard Module TBox Wait in Tosca Commander. The delay is the same as for the SoapUI TestStep. For further information on the standard Module TBox Wait, please refer to chapter "TBox Wait".

SoapUI TestStep Manual TestStep

SoapUI TestSteps of the Manual TestStep type are imported into a manual TestStep of the same name. The SoapUI description is transferred to the TestStepValue and the ActionMode Input is selected.

Deactivated SoapUI TestSteps

Deactivated TestSteps in SoapUI are also deactivated in Tosca Commander.

SoapUI Custom Properties

Tosca Commander saves text-based custom properties for the SoapUI project, the SoapUI Testsuite or SoapUI TestCases as buffers. These buffers are created automatically in the new TestStep folder Preprocessing under the TestStep Set Buffer and they are linked in the corresponding TestCase. The buffer name reflects the level, on which the custom property is defined in SoapUI. For further information on the standard Module Set Buffer, please refer to chapter "Buffer Operations".

SoapUI Groovy Script

Groovy Scripts will be added as attachments to a Groovy Script Module during the import and can be further used. This Module is contained in a TestStep of the TestCase. The TestStepValue Script Name corresponds to the name of the file which is located in the Module. When the TestStep is executed, the execution fails and a message indicating the attached script appears.

Example of an imported SoapUI project

In the example below, assertions are stored in SoapUI in the TestStep Add for the status code, and for the content by using XPath and Contains.

In Tosca Commander, the status code is transferred via the TestStep Send Add to the TestStepValue Communicate: SOAP over HTTP -> Receive -> Status code name. The response is saved to an XML resource that is automatically generated.

TestStep Send Add

Soap assertions for XPath or Contains are copied to the TestStep Verify Add.

The TestStepValue Path contains the path to the XML node AddResult. The TestStepValue XPath verifies whether the result of the XPath expression equals 3.

The Content TestStepValues use the dynamic expression CONTAINS to verify whether the XML resource contains the values indicated in square brackets.

TestStep Verify Add