简体   繁体   中英

Loop a static value in Jmeter http request

I have enums called MALE , FEMALE , OTHERS which needs to be send to my http request by looping it.

Scenario is when jmeter script runs, a http request will take the value MALE another thread can take the value as FEMALE and continues. This is important because every ENUM value reaches to different section of the backend system.

I would love hear a help.

在此处输入图像描述

you can see in the above body entity type needs to be changed to all the enums types.

Normally people go for CSV Data Set Config for this, however if for some reason you cannot or don't want to have external data files you can:

  1. Declare your ENUM values under ie User Defined Variables configuration element:

    在此处输入图像描述

  2. Use __RandomFromMultipleVars() function to select a random value from them:

     ${__RandomFromMultipleVars(MALE|FEMALE|OTHERS,)}

    在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM