Skip to Content
ScriptingOverview

Scripting

The scripting feature is available only in the paid version.

In Thunder Client, you can write custom scripts for advanced use cases like setting environment variables, extracting data from responses, test assertions, and more.

Inline Scripting

  • JavaScript code can be written directly within Thunder Client views.
  • You have the flexibility to write scripts in the following contexts:
    • Request Level
    • Folder Level
    • Collection Level
  • Additionally, scripts can be authored in Pre-Request and Post-Request scripts.

Pre-Request Script

  • Run the pre-request script from the Pre Run -> Scripting tab. This is useful for setting env variables.

img


Post-Request Script

  • Run the post-request script from the Tests -> Scripting tab.
  • Useful for clean-up tasks, setting environment variables from the response, and assertions.

img

Logs

  • You can log messages to the Output Window using console.log in the script.
  • For more details, please refer to the Logs section.

Convert Postman Script

  • We provide a guide to convert Postman scripts to Thunder Client scripts.
  • For more details, please refer to the Convert Postman Script section.
Last updated on

Morty Proxy This is a proxified and sanitized view of the page, visit original site.