I am getting response from Jmeter like this:
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.
Try something like:
encounterId=([0-9]+)
and use group 1 as the result.
or try this code regexId = '\d+';
var str = "<a href='/openmrs/module/moca/encounterViewer.form?encounterId=3537'></a>"
var regex = /<a.*?href='(.*?)'/;
var src = regex.exec(str)[1];
var numb = src.split("=")[1];
alert (numb);
Here is the XPath query:-
//input[@type="hidden"][@id="queueItemId"][@name="queueItemId"]@value
The most maintainable way in recent version of JMeter is to use CSS/JQuery Extractor:
The most performing one is to use new Boundary Extractor:
If you really want to use Regular_Expression_Extractor :