Define a testing method

This task describes how to select a testing method.

To define a testing method:

  1. Open the step properties: In the Step Navigator, right-click the step whose response you want to test, and select Show Arguments.

  2. Select the Output Argument node. For details, see New Web Service Call dialog box.

  3. Select a testing method and choose an expected response:

    • To perform negative testing only, select the Negative Testing check box and choose SOAP Fault as the Expected Response.

    • To accept any type of SOAP response, select the Negative Testing check box and choose Any SOAP as the Expected Response.

    • To perform positive testing only, clear the Negative Testing check box.

  4. Verify function in the script.

    In Script view, VuGen indicates the testing method with the ExpectedResponse argument. In the following example, the script performs negative testing, indicated by the SoapFault value:

  5. When you replay a script that results in a SOAP fault, VuGen saves the fault to a parameter called response. To check the returned value of the SOAP fault, evaluate the response output parameter using lr_xml_find.

    In the following example, lr_xml_find checks for a VersionMismatch SOAP fault and issues an output message.

                    "FastQuery=/Envelope/Body/Fault/faultString ",
    if (soap_fault_cnt >0) 
         lr_output_message{"A Version Mismatch SOAP Fault occurred")

    For more information about lr_xml_find, see the Function Reference (select the relevant version).

Back to top