Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JMETER a ${__RandomString function that is used for creating email addresses

Tags:

I have tried:

${__ RandomString (qwerty,"@",".com") }  

but it is not fine. I wonder how can I create this type of random email addresses? I haven't added anything in the Random Variable because I am not sure that I need to use it.

like image 871
godRA66 Avatar asked May 29 '15 13:05

godRA66


People also ask

Which function will be used to generate the random string in JMeter?

As per Using JMeter Functions guide __RandomString() function takes 3 parameters: Length of the desired random string. Source characters. If you need to store generated string into a JMeter variable you can provide variable name as 3rd argument.

How use JMeter function?

JMeter Functions and User Variables JMeter functions are special values that can populate fields of any Sampler or other element in a test tree. _functionName matches the name of a function. For example ${__threadNum}.


2 Answers

As per Using JMeter Functions guide __RandomString() function takes 3 parameters:

  1. Length of the desired random string
  2. Source characters
  3. If you need to store generated string into a JMeter variable you can provide variable name as 3rd argument.

So to get line of 10 alphabet characters you can use __RandomString function as follows:

${__RandomString(10,abcdefghijklmnopqrstuvwxyz,)}
like image 68
Dmitri T Avatar answered Sep 23 '22 14:09

Dmitri T


mail format:

RandomString(COUNT_OF_CHARS,LIST_OF_CHARS,) + '@' + RandomString(COUNT_OF_CHARS,LIST_OF_CHARS,) + '.' + RandomString(COUNT_OF_CHARS,LIST_OF_CHARS,)

We can specify how many characters it should contain using function ${__Random(MIN,MAX,)}

So finaly it may look like:

${__RandomString(${__Random(3,9,)},abcdefghijklmnopqrstuvwxyz,)}@${__RandomString(${__Random(2,3,)},abcdefghijklmnopqrstuvwxyz,)}.${__RandomString(${__Random(2,3,)},abcdefghijklmnopqrstuvwxyz,)}
like image 20
Pixi Dixi Avatar answered Sep 20 '22 14:09

Pixi Dixi