Generate code from Postman Collections

You can generate code for DevWeb testing from Postman Collections.

Note: Converting Postman files is supported from version 25.3, and released as Beta.

About converting Postman Collection files

Postman is an API development and testing platform. The Postman platform can be used to create Postman Collections, files in JSON format that are used to organize, group, and manage API requests and workflows.

To shorten scripting time, you can use the Offline Script Generator to convert Postman Collections into JavaScript functions, providing a format that is easy to read and maintain. The generated functions can be called from DevWeb scripts. When you run the conversion, the process generates a main.js for the workflow and all web requests that it finds in the collection.

If the collection contains APIs, the process generates an additional file, postmanApi.js, for the converted API functions. Each function includes parameters, and represents an API call in the collection file. The function can connect with the server to execute the operation described by the API call. When the function is called, it generates an API call on the application, and returns a web request. This process is very similar to the Swagger conversion, for details, see API testing.

Back to top

Generate scripts from Postman Collection files

You generate DevWeb script files from a postman_collection.json using postman mode.

Run the Offline Script Generator from the command line or from your IDE.

OfflineGenerator.exe –mode=postman <postman_collection.json path> <script directory path>

For more information on using the Offline Generator, see Offline Script Generator tool.

Back to top

See also: