Reputation: 61
I have a string in a jmeter response that has 5 values that I am trying to parse into separate variables. Does anyone have any guidance on how I may achieve this? Or is there a better post processor I should be using?
<a role="button" aria-label="Application RANUM20770" href="javascript://" onclick="changenew('ajLQ6VdK5xA3$pyWV$pII4Imx2WoN$p6OMtXEapDOiKzHYLh', 'aH$sRRQGllagYsNakUyuWhv6yV7x3q1S6HfC8Z$ptwPdTMo', 'arfpB11JptWMaFvd2xwkJyNlgHL$spkcuHbJhank$s6DONv', 'aQ877kS6ozZdrGgAFxb6mqEnzCFa09$sVWL$s68yj0rmcwr', 'a4oVRp9kcV4iber3oJSH2xQr3F6XsGB4DpCxgrMNI9y7U', 'no')" ><img src="/tm/images/idoc.gif" alt="Application RANUM20770" border=0></a>
I am using regex extractor to pull the values, for some reason the results aren't consistent. Sometimes the 2nd value pulls fine and other times it doesn't- without me changing anything.
Below are the regex expressions I am using :
${h_docname}" href="javascript:\/\/" onclick="changenew\('(.+?)',
'${p_vchnum_v}', '(.+?)', '
'${p_vchnum_v}', '(.+?)', '${p_ssn}'
'().+?', 'no'\)" ><img src="\/tm\/images\/idoc.gif" alt="Document ${h_docname}"
- name="vchdoctype" value="(.+?)">
Any help is greatly appreciated.
Upvotes: 0
Views: 7083
Reputation: 168092
JMeter uses Perl5-style regular expressions, hence try the following configuration of the Regular Expression Extractor:
value
changenew\('(.+?)', '(.+?)', '(.+?)', '(.+?)', '(.+?)', 'no'\)
$1$
This will result in variables like:
value=ajLQ6VdK5xA3$pyWV$pII4Imx2WoN$p6OMtXEapDOiKzHYLh
value_g=5
value_g0=changenew('ajLQ6VdK5xA3$pyWV$pII4Imx2WoN$p6OMtXEapDOiKzHYLh', 'aH$sRRQGllagYsNakUyuWhv6yV7x3q1S6HfC8Z$ptwPdTMo', 'arfpB11JptWMaFvd2xwkJyNlgHL$spkcuHbJhank$s6DONv', 'aQ877kS6ozZdrGgAFxb6mqEnzCFa09$sVWL$s68yj0rmcwr', 'a4oVRp9kcV4iber3oJSH2xQr3F6XsGB4DpCxgrMNI9y7U', 'no')
value_g1=ajLQ6VdK5xA3$pyWV$pII4Imx2WoN$p6OMtXEapDOiKzHYLh
value_g2=aH$sRRQGllagYsNakUyuWhv6yV7x3q1S6HfC8Z$ptwPdTMo
value_g3=arfpB11JptWMaFvd2xwkJyNlgHL$spkcuHbJhank$s6DONv
value_g4=aQ877kS6ozZdrGgAFxb6mqEnzCFa09$sVWL$s68yj0rmcwr
value_g5=a4oVRp9kcV4iber3oJSH2xQr3F6XsGB4DpCxgrMNI9y7U
So you will be able to use:
${value_g1}
- for 1st variable${value_g2}
- for 2nd variableSee
Upvotes: 1