But here above I need to pass one more required variable is “name”. And “name” should be like “firstname”.“lastname”
Ex . Anand.Thivari
But I want the “name” variable as dynamically assign when the request is sent to the server.
Likewise, “email” also posts dynamically.
Ex. [email protected]
Can anyone suggest how to resolve it?
Thanks in advance.!
var fname = "Aravind";
var lname = "Thivari";
var fullname = fname+"."+lname;
var email = fname+"@mail.com";
pm.environment.set("firstname",fname);
pm.environment.set("lastname",lname);
pm.environment.set("name",fullname);
pm.environment.set("email",email);
Thanks and pls suggest to me if have any other way.
-Rakesh
Instead of using the environment variable, you can also use, local variables if it is just a temporary thing.
For example,
pm.variables .set(“email”,email); // These are not direct visible like the environment variables, but of for a tempory thing it doessnt matter.
Or
pm.collectionVariables .set(“email”,email); // This is visible in your collection tab