Search code examples
jmeter

Jmeter Random function not generating question mark as string


I am trying to create a test in Jmeter but when the data comes to my backend, the text displayed in debugger is "????"

My Json

enter image description here

And my debugger is showing

enter image description here


Solution

  • You're using __RandomString() function in a weird way.

    As per Functions Helper Dialog it takes 3 parameters:

    1. Generated string length
    2. Source characters to generate the string from
    3. Name of JMeter Variable where to store the result

    enter image description here

    If you don't provide the Chars to use for random string generation it will generate the string from absolutely random characters which might be in different locales, i.e. Chinese and your HTTP Request sampler is not properly set for sending these characters.

    You can try amending your functions to restrict it to use only English characters:

    ${__RandomString(15,abcdefghijklmnopqrstuvwxyzz,)}
    

    More information on JMeter Functions concept: Apache JMeter Functions - An Introduction