Use request value from list of values in JMeter

前端 未结 4 1042
萌比男神i
萌比男神i 2021-02-07 04:21

I\'m sure I\'ve already done this in the past but somehow I cannot figure out how ;-) So, here\'s my problem:

I\'m trying to create a JUnit test plan in which a HTTP re

4条回答
  •  旧巷少年郎
    2021-02-07 05:16

    To obtain a random variable value from a list, first declare as User variables the list or available values, with a prefix and a incremental index:

    country_1     Spain 
    country_2     France  
    country_3     Portugal  
    country_4     Italy 
    country_5     England
    

    Then you can obtain a random value from the list concatenating the prefix with a random index in the interval:

    ${__V(country_${__Random(1,6,)})}  --> "Spain", "France", "Portugal", etc...
    

    Take a look to this answer for complete explanation.

提交回复
热议问题