I am getting response from Jmeter like this:
<input type="hidden" id="queueItemId" name="queueItemId" value="3256"/>
I wanted to get value 3256 from this and store it in a variable. Then i can use this variable further use like ${variable}
.
For this i am using RegularExpressionExtractor
in scope of the Sampler.
Please give me the regular expression to extract this value.
In JMeter, the Regular Expression Extractor is useful for extracting information from the response. For example, when you request a page and then need to get a link from the page that was downloaded.
$1$ to refers to group 1, $2$ to refers to group 2, etc. $0$ refers to whatever the entire expression matches.
2.6 Match No. We have 3 kinds of Match No: Use a value of zero to indicate JMeter should choose a match at random. A positive number N means to select the nth match. Negative numbers are used to returns all matches.
Try something like:
encounterId=([0-9]+)
and use group 1 as the result.
Better than using regular expression to extract that value I would suggest using XPath Extraction like this:
//form[@name='MyForm']//input[@name='queueItemId']/@value
Where MyForm
is your form name, replace with whatever you have.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With