gpt4 book ai didi

jmeter - 在jmeter中获取随机用户定义的变量

转载 作者:行者123 更新时间:2023-12-05 02:19:26 24 4
gpt4 key购买 nike

I have user defined variable like this.

url_1
url_2
url_3
.
.
.
url_n

In HTTP Request sampler i have to randomly select any one of these URL's .So in server name textbox i am trying this ${url_${__Random(1,7)}} But it is not fetching the variable. How can i fetch the value of that variable. I am also getting the following error.

java.net.URISyntaxException: Illegal character in authority at index 7: http://${url_${__Random(1,7)}}/ at java.net.URI$Parser.fail

最佳答案

使用__V() function喜欢:

${__V(url_${__Random(1,7,)})}

根据函数文档:

For example, if one has variables A1,A2 and N=1:

  • ${A1} - works OK
  • ${A${N}} - does not work (nested variable reference)
  • ${__V(A${N})} - works OK. A${N} becomes A1, and the __V function returns the value of A1

如果您需要更多信息:Here’s What to Do to Combine Multiple JMeter Variables

关于jmeter - 在jmeter中获取随机用户定义的变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42943965/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com