Starting with Desktop App version 2.17.0, you can create snippets for your API tests!
Previously, pre-request and post-request scripts in API tests were managed individually at the request and test levels. With this update, you have the flexibility of building your custom scripts using one or more snippets.
Just like snippets for browser and mobile tests, API snippets may be saved as one-time or reusable, giving you more control over how you manage your custom scripts.
Adding API snippets
API snippets are available for pre- and post-request scripts at both the test and request level. If you are new to adding custom scripts in mabl API tests, see our documentation on adding snippets to API tests.
The new UI includes options to create new snippets and edit existing snippets. Any existing scripts are automatically converted into one-time snippets when the test is opened.
To preview all of your snippets end-to-end, click on “Preview script”.
GenAI Snippet Generation
Just like the Snippet Editor for browser and mobile tests, the API Snippet Editor also supports GenAI Snippet Generation. If you need help getting started with an API snippet, try describing what you want to do in the prompt.
API snippets continue to support use of Postman’s PM library and mabl variable syntax in all snippets.
Learn more
To learn more, check out the following docs: