简体   繁体   中英

unable to extract value using Regular Expression in JMeter

I am unable to extract value using both Regular Expression and xPath in JMeter

<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:

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 query looks correct.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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