【发布时间】:2015-12-16 20:51:41
【问题描述】:
有人可以帮我吗?我正在尝试在 Jmeter 中发布 http 帖子,http 工作正常,但我想从响应中提取 LastName 值以在下一个 http 请求中使用。我尝试了几种使用 Xpath Extractor 的方法,但 Debug 采样器什么也没显示。我已将 XPath_Extractor 添加为 HTTP Sampler 的子项。 我在这里做错了什么?
这是我在 XPath 提取器中设置的内容
Reference Name = lstname(这是我携带到下一个http请求的变量)
XPath 查询 = //*[local-name()='LastName']/text()
也试过
/Reply/CustomerData/@LastName
检查主样本
使用命名空间 - 检查
选中忽略空格
这是我的 http 响应
<?xml version="1.0" encoding="UTF-8"?>
<dm:reply xmlns:dm="http://www.xx.com/dm" version="1.0">
<Session>
<TimeDate CurrentDateTime="2015-12-16T08:57:21" CurrentMilliseconds="2881062362"/>
<Reply type="Connection">
<ErrorMessage/>
<ErrorCode>0</ErrorCode>
</Reply>
<TimeDate CurrentDateTime="2015-12-16T08:57:21" CurrentMilliseconds="2881062504"/>
<Reply type="Execute">
<CustomerData FirstName="" LastName="Moni" Address="SD" Chassis="AWD" CountryOfBirth="" CountryOfOriginFullName= Year="2010">
<RecordSet>
</RecordSet>
<ErrorMessage/>
<ErrorCode>0</ErrorCode>
</CustomerData>
</Reply>
<TimeDate CurrentDateTime="2015-12-16T08:57:21" CurrentMilliseconds="2881062590"/>
</Session>
</dm:reply>
【问题讨论】:
标签: jmeter