I have a list of values ["Sport","movies"]
I need to pass value "Sport" 90 percent of times and "movies" 10% of times to variable name result.
Is there any way/JMeter function, to get specific value X percent of times.
We have Random function but it returns random value.
Can any one help on this.
>Solution :
The easiest way is creating a CSV file with 9 lines of Sport and one line of movies and then read this file in the CSV Data Set Config.
Alternatively you can use a suitable JSR223 Test Element or __groovy() function with the following code:
def list = (1..9).collect { 'Sport' }
list.add('movies')
vars.put('result', list.get(org.apache.commons.lang3.RandomUtils.nextInt(1, 10)))
More information on Groovy scripting in JMeter: Apache Groovy: What Is Groovy Used For?