Testing a script

To test a script:

  1. Switch to the Testing tab in the Script details page.
  2. In the Input Variables area paste or upload the input data for particular input variables.
    Note: For Variables of data type string or binary, click the Upload icon to upload the document and select the appropriate file. After uploading the file, you can preview the content of the binary input variable by clicking Preview.

    These are the supported binary types for preview: .png, .jpg,..gif, .bmp, .pdf, .docx, .xlxs

    For Variables of data type Boolean select true or false from the list.

  3. Click the Expand icon to expand the input area of data type string. To exit the expanded area click Back.
  4. Click Test to run the script with the input data.

    The results of the test are displayed on the Output Variables panel. Additionally, you can preview or download the output variable of data type binary. When downloading the binary content to your local disk, the file extension is added to the binary formats recognized by ION Scripting. Otherwise the file extension is not added.

    These are the supported formats:

    • .png
    • .jpg
    • .gif
    • .bmp
    • .pdf
    • .docx
    • .xlxs

    You can also download the content or expand the output data of type string.

    The output can contain this information:

    • The expected output payload.
    • Python exception.
    • Scripting limitation exception.

    Executing a test requires that the script is saved. When you have unsaved changes in your script at the moment of testing, a confirmation dialog box is displayed. You are asked to proceed with the test and save the script changes or cancel the test.

    When the testing execution completes, the Performance Metrics in the right panel get updated to show this information:

    • The Execution Time - How long the script was running, between 0 and 30 seconds.
    • The Input Payload Size - What the size of the input payload was, between 0 and 5 MB.
    • The Output Payload Size - What the size of the output payload is.
    Execution time

    When testing, execution is limited to a maximum of 30 seconds. In runtime, the maximum script execution time is 15 seconds.

    Use testing and performance metrics to verify that runtime execution fits within the execution time limit.

    If test execution takes more than 15 seconds, Execution Time is highlighted in red.

    Input and Output payload size

    A script can process and produce payloads up to 5 MB.

    Performance metrics for payloads can help you understand how the script performs with different payload sizes.

    We recommend that you test the script with the largest expected payload. Verify that Execution Time is within the 15-second runtime limit and that the generated output is less than 5 MB.