简体   繁体   English

无法在JMeter中使用正则表达式提取值

[英]unable to extract value using Regular Expression in JMeter

I am unable to extract value using both Regular Expression and xPath in JMeter 我无法在JMeter中使用正则表达式和xPath提取值

<input id="capture_signin_transactionId_u13jjd6w9y1h167bhu5ut4fhbht0kwebuvqi6f0z" class="capture_transactionId_u13jjd6w9y1h167bhu5ut4fhbht0kwebuvqi6f0z" type="hidden" name="capture_transactionId" value="u13jjd6w9y1h167bhu5ut4fhbht0kwebuvqi6f0z" data-capturefield="undefined">

Regular Expression Extractor used: 使用的正则表达式提取器:

Reference Name - capture_transactionId
name="capture_transactionId" value="(\w+{40}?)"
Template $1$
Match 1
Default Value - n/a

XPath extractor used: 使用的XPath提取程序:

Reference Name - capture_transactionId
xPath Query - //input[@type="hidden"][@name="capture_transactionId"]/@value

But I am unable to capture value. 但是我无法获取价值。

Since you are using XPath Extractor to parse HTML (not XML) response ensure that Use Tidy (tolerant parser) option is CHECKED (in XPath Extractor's control panel ). 由于您使用的是XPath Extractor来解析HTML(不是XML)响应,因此确保已选中Use Tidy(宽容的解析器)选项(在XPath Extractor的控制面板中 )。

XPath query looks correct. XPath查询看起来正确。

You need to update the Regular Expressions Extractor as follows: 您需要按以下方式更新正则表达式提取器:

Reference Name - capture_transactionId
name="capture_transactionId" value="(.*?)"
Template $1$
Match 1
Default Value - n/a

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM