TruClient Create a Random Email ID using Java Script Code

Problem 1 – Need a unique value for Email each time I run the script

Solution 1 – Create a global variable to perform the logic for Email ID creation

Drag JavasScript from the toolbox to just above the step u need the E-mail.

In the ‘code’ of Evaluate Java Script Code – add the logic to generate a random Email ID1 Global.Email = "Load" + TC.getParam("RandomNumber5")+ "@test" + TC.getParam("RandomNumber3")+".com"

Make sure that the parameters is defined in the VUser. Eg : TC.getParam(“RandomNumber5”)+

Then the usage is pretty straight forward. Just enter the values as Global.Email

Note – Global keyword makes the variable global and available to other methods.

Leave a Comment

Your email address will not be published. Required fields are marked *