This topic explains how to configure and apply the REST URL Data Bank tool, which enables you to extract values from REST URLs for use in your testing activities. URLs can also be sent to a Writable Data Source and accessed in the Extension Tool, or it can be sent to variables for easy reuse across the .tsts (Test Suites), Responder Suites, or Action suites.
Understanding the REST URL Data Bank
This tool enables you to extract the following values from a REST URL and store them in a data bank:
- Host
- Port
- HTTP Method
- Path (by index)
- Parameter (by name)
You can extract parameters that occur multiple times by concatenating the values.
Adding the REST URL Data BankTool
- Right-click the action suite or responder associated with the data you want to extract and choose Add Output...
- In the Add Output wizard, choose REST URL Data Bank in the tools panel and click Finish. If you are viewing tools by category, the REST URL Data Bank is in the Data Exchange folder.
- You can add a name for your instance of the tool and configure the tool settings (see Configuring the REST URL Data Bank Tool).
- Save your changes.
Configuring the REST URL Data Bank Tool
- In the Tool Settings section, choose the components you want to extract from the REST URL by clicking on a value in the Available REST Extractions column.
- Click Add. The URL components will be added to the Extract panel.
- To change how the value is saved in the data bank, select a component and click Modify.
- custom column name: Choose this option to specify the name of the data source column in which to store the value. Values are stored in an internal data source unless you specify otherwise (e.g., if you select Writable data source column or Variable). This is the name you will use to reference the value in other places. For example, if it is stored in a data source column named My Value, you would choose My Value as the parameterized value. You could also reference it as
${My Value}
in literal or multiple response views.
Writable data source column: Choose this option to store the value in a writable data source column
(see Configuring a Writable Data Source in SOAtest or Configuring a Writable Data Source in Virtualize).
This allows you to store an array of values. Other tools can then iterate over the stored values.
Variable: Choose this options to save the value in the specified variable so it can be reused across the current Test, Responder, or Action suites. The variable must already be added to the current suite as described in
Defining Variables (SOAtest) or Defining Variables (Virtualize).
Any values set in this manner will override any local variable values specified in the Responder suite or Action suite properties panel.
- If you are modifying the Path extraction, you can change the path index setting.
The index refers to the position in the path according to the following schema:
<host>:<port>/<method>/<path 0>/<path 1>/<path . . .>/<parameter>
You can only extract one host, port, and method, but you can add several path and parameter values to extract complex URLs.
- custom column name: Choose this option to specify the name of the data source column in which to store the value. Values are stored in an internal data source unless you specify otherwise (e.g., if you select Writable data source column or Variable). This is the name you will use to reference the value in other places. For example, if it is stored in a data source column named My Value, you would choose My Value as the parameterized value. You could also reference it as
- Configure any additional options (see Tool Options) and save your changes.
Tool Options
The following options can be configured
- Extract empty elements as: Specifies whether or not empty elements will be extracted. When this option is enabled, you can use the adjacent text field to specify a text string that indicates what "placeholder" value should be added for every empty extracted element.
- Extract missing elements as: Specifies whether or not missing elements will be extracted. When this option is enabled, you can use the adjacent text field to specify a text string that indicates what "placeholder" value should be added for every missing extracted element.