1
我试图在$ {__ P()}函数内插入一个变量,并且已经读取了关于此问题的几个线程,但它不起作用。我的用户定义的变量包括:
FALLBACK_TOKEN someLongString
ACTUAL_TOKEN ${__P(tokenSetOnCommandLine,???)}
到目前为止已经试过:
ACTUAL_TOKEN ${__P(tokenSetOnCommandLine,${FALLBACK_TOKEN})}
// literally returns "${FALLBACK_TOKEN}" (as expected as per Jmeter docs)
ACTUAL_TOKEN ${__P(tokenSetOnCommandLine,${__V(${FALLBACK_TOKEN})})}
// same as above
ACTUAL_TOKEN ${__P(tokenSetOnCommandLine,${__evalVar(${FALLBACK_TOKEN})})}
// returns blank
ACTUAL_TOKEN ${__P(tokenSetOnCommandLine,${__eval(${FALLBACK_TOKEN})})}
// literally returns "${FALLBACK_TOKEN}"
ACTUAL_TOKEN ${__P(tokenSetOnCommandLine,${__eval(FALLBACK_TOKEN)})}
// returns "FALLBACK_TOKEN"
ACTUAL_TOKEN ${__P(tokenSetOnCommandLine,${__evalVar(FALLBACK_TOKEN})})}
// returns blank
按的JMeter文档在http://jmeter.apache.org/usermanual/functions.html#__evalVar,我希望无论是evalVar
或eval
工作(仍然在分歧有点不清楚,到说实话)。我错过了什么?
谢谢更多信息,请Apache JMeter Properties Customization Guide。这不是我希望得到的答案,但它确实解释了我为什么遇到麻烦。 – ebr