Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space FUNCTDEV and version SVC2021.2

...

Users typically configure a JSON Data Bank in SOAtest by accessing the "Use Data Source Wizard" while parameterizing a value in a tool such as the REST Client or Messaging Client tool. This provides a quick, intuitive, and largely automated way to extract data from one tool and use it another. You simply go to the tool where you want to insert extracted data, then use a wizard to specify what data (e.g., from what tool) you want to extract. This is the usage model demonstrated in the Storing Results to Be Used in Subsequent Tests tutorial. This same method can be used to extract data that is used to set a variable. Alternatively, you can manually configure a JSON Data Bank tool to extract data from one tool, then manually configure other tools to use the extracted values.

...

You can use a JSON Data Bank in Virtualize, for example, to extract a value from an incoming request and use it to populate an element of the response to be sent when that request is received. You can configure JSON Data Banks automatically when using wizards to create virtual assets from traffic. In addition, you can use the "Use Data Source Wizard" to extract a value and use it as a parameterized value in a response. For Message Responders, you can extract values from the incoming request (body or header); for other tools (e.g., tools used in action suites), you can extract values from another tool in the suite. Another option is to manually add a JSON Data Bank tool (as an output to an existing tool) that extracts the desired data, then configure other tools to use the extracted data.

Video Tutorial

In this video, you'll learn how to extract values from JSON responses and reuse them in other tests.

Vimeo
URLhttps://player.vimeo.com/video/124446480


Configuring JSON Data Bank Using the Data Source Wizard

...

To use the "Use Data Source Wizard" wizard to configure a JSON Data Bank:

  1. (Not applicable for use with Message Responders) Ensure that you have a test suite or action set with at least two tools.

  2. In the configuration panel for the tool that you want use the extracted value, select one of the available Form views.
  3. Go to the message element that you want to use the extracted value, then select Parameterized and Use Data Source Wizard from the available drop-down menus.



  4. In the wizard that opens:
    1. For test and action suite tools, select the tool you want to extract a value from. The drop-down menu at the top of the panel will contain all tools in the test or responder suite that occur before the current tool you are configuring. For example, if you are configuring tool 4, tools 1, 2, and 3 will display in this menu along with any data sources that may be available.
    2. For Message Responders, select the incoming request message that you want to extract a value from, then specify whether you want to extract values from the message body or message header.Under Expected Message, indicate what element(s) you want to extract, then click Add. The right panel lists the values you have configured for extraction and shows the name of the data source column where each value will be stored (if you keep the default setting).

...

You can also manually chain the JSON Data Bank tool to a tool within the test, Responder, or Action suite. To configure the JSON Data Bank as a chained tool, complete the following:(Not applicable for use with Message Responders)

  1. Ensure that you have a test suite or action set with at least two tools.

  2. Right-click the node for the tool associated with the data you want to extract(e.g., if you want to extract a value from an incoming request or outgoing response, choose the Message Responder that handles those messages), then choose Add Output.

  3. In the Add Output wizard, indicate where you want to extract the value from(e.g., Incoming Request, Transport Header, Incoming Attachment, Outgoing Response, etc), select JSON Data Bank from the list of tools, then click the Finish button. A JSON Data Bank node displays below the tool.

  4. Configure the tool as follows:
    1. Use the available controls to specify what element you want to extract. To extract an element, select a value from the JSON tree and click the Extract Element button. The value you added displays in the Selected Element list with a Data Source Column name containing the name of the tool the value came from, as well as the extracted value.

      Info
      iconfalse
      titleWorking with the Expected Message

      The left panel displays the expected JSON response used to create a template from which you can select elements. If JSON Data Bank receives a valid JSON message (e.g., from traffic or as defined in the client tool it is attached to), this panel will be populated automatically. Alternatively, you can copy a sample message into the Literal or Tree tabs. Note that the expected JSON does not get saved by default; if you want to save it, enable the Save Expected JSON option.

    2. If you later want to modify the element referenced by the extraction, click Modify, then modify it as desired. See JSON Selector Reference for details.

    3. Repeat steps a and b as needed to configure any additional extractions you want performed.
    4. In the bottom area of the JSON Data Bank configuration panel, customize the options as desired. See Tool Options for details

...