Extracting value from HTML Responce using Regular

2020-02-07 03:10发布

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.

8条回答
唯我独甜
2楼-- · 2020-02-07 03:37

The following regular expression will match the parameter and its value:

\bencounterId=(\d*)

The parentheses enable extraction of the value. Note the word boundary \b which makes sure a parameter ending with encounterId such as fooencounterId is not matched.

查看更多
我欲成王,谁敢阻挡
3楼-- · 2020-02-07 03:38

Try something like:

encounterId=([0-9]+)

and use group 1 as the result.

查看更多
登录 后发表回答