Jmeter random

__Random

Examples:

${__Random(0,10)}

will return a random number between 0 and 10

${__Random(0,10, MYVAR)}

will return a random number between 0 and 10 and store it in MYVAR. ${MYVAR} will contain the random number

__RandomString

Examples:

${__RandomString(5)}

will return a random string of 5 characters which can be readable or not

${__RandomString(10,abcdefg)}

will return a random string of 10 characters picked from abcdefg set, like cdbgdbeebd or adbfeggfad, …

${__RandomString(6,a12zeczclk, MYVAR)}

will return a random string of 6 characters picked from a12zeczclk set and store the result in MYVAR, MYVAR will contain string like 2z22ak or z11kce, …

__RandomFromMultipleVars

Examples:

${__RandomFromMultipleVars(val)}

will return a random string based on content of variable val taking into account wether they are multi-value or not

${__RandomFromMultipleVars(val1|val2)}

will return a random string based on content of variables val1 and val2 taking into account wether they are multi-value or not

${__RandomFromMultipleVars(val1|val2, MYVAR)}

will return a random string based on content of variables val1 and val2 taking into account wether they are multi-value or not and store the result in MYVAR

Leave a Reply

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