jmeter - Pass JMeter property value generated by JSR233 sampler to new request
问题描述
JSR233 sampler with Beanshell been used to convert xml file to encoded string and the value is getting printed in Jmeter console. Able to extract the value within the same sampler using JMeter properties however unable to use the same variable to new request, it goes as null/void.
Test Plan is as below:
.jar file is configured under TestPlan>classpath (Browsed the jar file) which has all methods defined to encode
Added Thread Group>JSR233 sampler
The variable value "a" and property value "storeid" is getting printed on JMeter console, also JMeter logs successfully as "storeid value is : abcdefxcfdfd".
When trying to use this 'storeid' or 'a' value to next http request (ex: path:
${__property(storeid)})
, it goes as null or tried with ${a}.Also tried with vars.get and vars.put, in this case value goes as void.
How to get this variable value passed to the next request?
解决方案
If you want to set property use props
props.put("storeid", a);
Don't use ${
syntax inside JSR223 script
推荐阅读
- javascript - 为什么我的分页数据表在使用 Javascript 时不起作用?
- android - 在某些情况下,使用 Android 数据绑定的 Robolectric 挂起
- javascript - 在 Bootstrap 3 轮播中排队点击事件
- development-environment - Mendix 是否生成任何特定语言的源代码,可以编辑和重用?
- r - 根据字符将数据框中的单元格相乘
- java - 使用java将数据的Arraylist写入excel
- java - “错误:程序类型已存在:com.google.zxing.aztec.detector.Detector”
- c# - 使用 Vlc.Dotnet for WPF 从流中播放视频
- java - 类型推断:泛型,“var”
- intellij-idea - 在 Intellij 中有任何依赖分层视图吗?