The Data Repository CRUD Tool enables you to update data set records in the connected data repository during your testing activities. 

Native CRUD tool versus the CRUD extension

The Data Repository CRUD Tool Extension also allows you to manipulate data in a data repository, but requires additional configuration that is not required with this tool.

In this section:

Introduction

The Data Repository CRUD tool is intended to help you automate actions that require data in the repository to be modified, such as changing the value of account balances in a banking application. It can perform the following operations on records in your data repository:

  • delete data set records
  • update existing data set records
  • create new data set records

The primary use-case is to add the tool as an output to your Message Responder and configure operations to perform on the data when a message is sent to the virtual asset. You can manually configure the tool operation settings or script changes to record values before updating the data repository.

General Configuration

  1. Right-click on your responder and choose Add Output...

  2. Select an incoming request type in the wizard and choose Data Repository CRUD Tool. 
  3. Click Finish and specify a name for the tool (optional).
  4. Click Add in the Configuration tab and specify name for the operation (optional).
  5. Enable the Create, Update, or Delete option.
  6. Choose the data repository data source you want to perform the operation on from the Data Source drop-down menu.
  7. Click Add in the Correlation section and specify the correlation columns and values of the data set records that you want to manipulate. See Data Source Correlation Tab for details on how to configure data source correlation criteria.  

  8. Configure the specific settings for CreateUpdate, or Delete operations and save your changes.
  9. You can add additional configurations so that you can perform multiple operations on multiple fields in the same execution.
  10. Deploy your responder and execute your client to perform the operations you configured on the connected repository.

Create Configuration

Specify your method for creating new records in the Create settings section. 

Complex Values

The Complex option enables you to manually enter the new structure and value.

  1. Click Edit JSON to open an editor for specifying the record. A JSON template of the record structure will be pre-populated by default.
  2. Choose the Form JSON view or Literal view from the Input Mode drop-down. The Form JSON is selected by default.  
  3. Specify the values and click OK. You can also click Reset Template to reset the form based on the existing JSON structure. 

    The Form JSON view also supports cut, copy, delete, and insert action from the right-click menu.
     
  4. Click OK. The Value field will show a preview of the JSON. 
     

Scripted Values

You can also choose Scripted and construct the JSON payload through scripting

See Extensibility and Scripting Basics for additional information.

Parameterized Values

If your tool is connected to a data bank tool, you can choose Parameterized and choose extracted values from the drop-down menu (also see Parameterizing Tools with Values Extracted from Another Tool (Virtualize) or Parameterizing Tests with Values Extracted from Another Test (SOAtest)).

Operation Settings

Enable the Replace existing correlation match option to update an existing record if a matched correlation is found.

Update Configuration

Specify the location of the record you want to update using an XPath-like selector for accessing records in the data repository.

  1. Click Add and specify the update mode. The following modes are available: 
    1. Replace Element(s). This mode updates the value of individual primitive records, such as strings.
    2. Replace List. This mode updates non-primitive values, such as arrays.    
    3. Append to List. This mode adds a value to the end of an array. 
    4. Prepend to List. This mode adds a value to the beginning of an array.
    5. Delete from List. This mode removes a value from an array.
  2. Specify the location of the element you want to update in the location field.
  3. In the Value field, specify the new value using one of the following options:
    1. Choose Simple to enter a fixed value. You can also choose the special [exclude]  or [null] values from the the drop-down menu. 
    2. Choose Scripted and click Edit Script to programmatically specify a new value based the existing record. 
    3. Choose Parameterized and choose an extracted value from the drop-down menu.
    4. Choose Complex and click Edit JSON to manually specify updates to the structure and values of the record. You can modify the JSON using the Form JSON view (default) or Literal view. Click Reset Template to undo modifications. The Form JSON view also supports cut, copy, delete, and insert action from the right-click menu.
  4. Click OK
  5. Enable any additional settings in the Operation Settings section: 
    1. Enable the Create if unable to update option to create a new record if an existing record cannot be found. 
    2. Enable the Fail on correlation and update errors option to prevent the tool from update the repository if errors are reported. This option is enabled by default. 

Delete Configuration

If the Delete operation is enabled, any record matching the correlation criteria configuration settings (see General Configuration) will be deleted.

You can enable or disable the Fail if no correlation match option. 

  • No labels