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 drop-down 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, the execution is limited to a maximum of 30 seconds. In comparison, the maximum script execution time in runtime is 15 seconds.

    You can use the testing and performance metrics to ensure that the scripts runtime execution can fit within the imposed execution time limits.

    If the test execution takes over 15 seconds, then this is indicated by highlighting the Execution Time in red.

    Input and Output payload size

    Script can process and produce payload up to 5 MB in size. The performance metrics for the payloads can help you understand how the script can perform with different payload sizes.

    We recommend that you test the script with the largest expected payload. This is to ensure that the Execution Time is within the limit of 15 seconds running time. And that the output that is generated is less than 5MB.