My question:
I am getting following error in pre-request script
Details (like screenshots):
I am doing Postman Fundamentals Course by Nat Taylor on Pluralsight and came across this script to create variables to use them in later requests. Please see the script below and let me know if you see any issues and how to fix them.
pm.globals.set(“numberofUsers”, 2);
pm.globals.set(“currentUserCount”, 0);
pm.globals.set(“numberofWishlistAdds”, 4);
pm.globala.set(“currentWishlistcount”, 0);
pm.globals.set(“wishlistIds”, );
const getBooks= {
url: 'http://${pm.environment.get("host")}/books',
method: "GET",
header: "G-TOKEN:ROM831ESV"
}
pm.sendRequest(getBooks, function(err, books){
const ids = _.map(books.json(), function(book){
return book.id;
});
pm.globals.set("bookIds", ids)
})
How I found the problem:
I’ve already tried: