0
votes

Want to Extract name and value from Response.

input type="hidden" name="IbkVkZ7Zhk8=" value="B7DDe0z5xEGnlxKhPTQccoYGyA3Xk3lwHPDfzH6kGoQGHnVt6QHYI93OjGmtaEjr"

I am using Regular expression Extractor as Below :

1.tokenName

input type="hidden" name="(.+?)=" value=""

2.tokenValue

input type="hidden" name="${tokenName}" value="(.+?)"

but it doesn't work for me.

1
Give in a sample of your data and the regex that you have used so far. - cyber_rookie
i have updated Question Please take a look ..thanks - Devang
The regex seems fine, syntax-wise, try to check in with some other setting for the Regular Expression Extractor. - cyber_rookie
name and value both are different for each user so , it seems like unable to get value of tokenName using value=" " . - Devang
Maybe you shouldn't use two different expressions, use a single regex to extract both, like input type="hidden" name="(.+?)=" value="(.+?)" and the regex should give you two different matches, the first one is the tokenName and the second is the tokenValue. - cyber_rookie

1 Answers

0
votes

Use the following Regular Expression Extractor configuration:

  • Reference Name: anything meaningful, i.e. test
  • Regular Expression: input type="hidden" name="(.+?)" value="(.+?)"
  • Template: $1$

This will generate 2 match groups and you will be able to address

  • "name" as ${test_g1}
  • "value" as ${test_g2}

Regex Tester

You can use View Results Tree listener in combination with Debug Sampler to visualize Regular Expression Extractor matches results.

See How to debug your Apache JMeter script guide for more tips.