You can export a testsheet into well-formed JSON documents. Exporting Testsheets into JSON documents is quite useful:

  • As a template for structuring much larger data sets for subsequent JSON Import (as described above)
  • As a JSON payload to test a deployed Decision Service on the Server
Note: You can chose to exclude transients when you export Testsheets to JSON using the Exclude Transients option. For example, select Ruletest > Testsheets > Data > Input > Exclude Transients to set your preference to exclude transients. Clear the option to include transients in the exported document.

Input

To generate the Input column of a testsheet to JSON, either:
  • Choose the menu command Testsheet > Data > Input > Export Request JSON
  • Right-click in the Input column, and then choose from:
    • Export JSON to file...
    • Export JSON to Clipboard

The output from a simple Cargo test is as shown:

It is good idea to change the name value to an appropriate name for the deployed Decision Service it will be calling; in this case, Cargo.

Note: You cannot export a testsheet as native JSON.

Output

To generate the Output panel of a testsheet to well-formed JSON either:
  • Choose the menu command Testsheet > Data > Output > Export Request JSON
  • Right-click in the Output column, and then choose from:
    • Export JSON to file...
    • Export JSON to Clipboard

You cannot import into the Output column.

Expected

To generate the Expected panel of a testsheet to well-formed JSON either:
  • Choose the menu command Testsheet > Data > Expected > Export Request JSON
  • Right-click in the Expected column, and then choose from:
    • Export JSON to file...
    • Export JSON to Clipboard