General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
PogoTheMonkey
Valentin Despa
comments
Comments by "PogoTheMonkey" (@pogothemonkey7461) on "How write API Tests with Postman in 3 easy steps (PART 2/3)" video.
@12:25 when you explain arrays being zero indexed, I believe you could then switch over to the console to show the array from the previous console.log query you made because in the console it shows the indexes visually, as "keys" - this would help cement the whole "array being zero indexed" fact (for those who don't know arrays from before) - you could also mention its the same for strings as added useful info ^^
1
@vdespa I haven't added the dynamic element yet, its just about figuring out where the date variable goes and concatenating. my question is relative to the use of the variables. How come the {{currentDate}} variable can be written without quotation marks, but the {{name}} & {{email}} require it, even though they have all been declared in the same way, in the Pre-req. section using the pm.globals.set(); method?
1
Body : { "name":"{{name}}", "email":"{{email}}", "permissions":[2000,3000,4000], "currentDate":{{currentDate}} } Pre-req : let date=Date.now(); pm.globals.set("currentDate", date); pm.globals.set("name","John Doe"); pm.globals.set("email","emailmehere"+date+"@email.com"); ------------------------------ // I realize the permissions and currentdate weren't requested but I figured I might as well leave them.
1
did I win something? :D
1
@vdespa yes, when declaring a variable. Here I was assuming that the pm-variables could be used the same way as normal js-variables where you don't need to add the quotes. so if {{name}} contains a string I must always refer to it as "{{name}}"?
1