参数化 JMeter 记录
我正在尝试运行记录并将其参数化,以便它可以从电子表格中获取用户名、密码和申请编号。步骤之一 ctl00_ctl00_body_PageMainContent_ctl00_ContractingOfficer_ClientState 有一个硬编码条目 {"enabled":true,"emptyMessage":"","validationText":"DRULE","valueAsString":"DRULE","lastSetTextBoxValue":"DRULE"} 我尝试在所有位置将“DRULE”替换为变量 ${UserName}失败了,我也尝试替换lastSetTextBoxValue,但也失败了。任何帮助将不胜感激。
I am trying to run a recording and parameterize it so that it can grab the username, password, and requisition number from a spreadsheet. One of the steps ctl00_ctl00_body_PageMainContent_ctl00_ContractingOfficer_ClientState has an entry hardcoded {"enabled":true,"emptyMessage":"","validationText":"DRULE","valueAsString":"DRULE","lastSetTextBoxValue":"DRULE"} I tried to replace "DRULE" with the variable ${UserName} in all places and it failed, I also tried replacing the lastSetTextBoxValue and it also failed. Any assistance would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将用户定义变量添加到您的测试计划(如果您使用录制模板(它应该已经存在)并使用
DRULE
值定义UserName
变量:一次您执行此操作,请求中出现的所有
DRULE
都将替换为${UserName}
关于您的
ctl00_ctl00_body_PageMainContent_ctl00_ContractingOfficer_ClientState
参数,我认为它需要是 相关Add User Defined Variables to your Test Plan (if you're using Recording Template it should already be there) and define
UserName
variable with the value ofDRULE
there:Once you do this all occurrences of
DRULE
in the requests will be replaced with${UserName}
With regards to your
ctl00_ctl00_body_PageMainContent_ctl00_ContractingOfficer_ClientState
parameter I believe it needs to be correlated