Complete the code to import a Postman collection from a JSON file.
pm.collection.import([1]);
The import method requires the file path of the collection JSON to import it.
Complete the code to export the current Postman collection as a JSON object.
const exported = pm.collection.[1]();The toJSON() method converts the collection to a JSON object for export.
Fix the error in the code to correctly export a collection to a file.
pm.collection.export([1]);The export method requires a callback function to handle the exported data.
Fill both blanks to import a collection and then log its name.
pm.collection.import([1]).then(collection => { console.log(collection.[2]); });
First, import the collection using the file path, then access its name property to log it.
Fill all three blanks to export a collection, convert it to a string, and save it to a file.
pm.collection.[1](collection => { const jsonString = JSON.[2](collection); saveToFile(jsonString, [3]); });
toJSON instead of stringify.Use export to get the collection, JSON.stringify to convert it to a string, and provide the filename to save.