You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by venkatakurathi <ve...@hotmail.com> on 2012/05/28 14:54:08 UTC

need help with regular expression(regexp tester)

Hi All,

i am facing an problem with extracting the required string from response.
the below is the response
"jobId\":\"32c1919e-a8c3-11e1-9220-00163e7f6087\",\"Status\":\"COMPLETED\",\"Percentage\":100}')"}


i need to get the status completed(until then the loop runs)

the regexp i used :

\\",\\"Status\\":\\"(.+?)\\",\\"

when i checked it with regexp tester it is showing the output.

during run time i added debug sampler to check the values we are
capturing....then is showin my default value "ERROR".

can some one assist me in why this difference b/w regexp tester and debug
sampler.

what could be the proper regular expression to extract the string?

-----
Venkat Akurathi
91-9703186688
--
View this message in context: http://jmeter.512774.n5.nabble.com/need-help-with-regular-expression-regexp-tester-tp5713371.html
Sent from the JMeter - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: need help with regular expression(regexp tester)

Posted by venkatakurathi <ve...@hotmail.com>.
i tried all possible expressions along with expr what you send.but no luck.

my reg exp is inside the sampler only which comes under the while
controller.

i am stuck up with here nd unable to go further...
plz suggest me in resolving this.

-----
Venkat Akurathi
91-9703186688
--
View this message in context: http://jmeter.512774.n5.nabble.com/need-help-with-regular-expression-regexp-tester-tp5713371p5713386.html
Sent from the JMeter - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: need help with regular expression(regexp tester)

Posted by Flavio Cysne <fl...@gmail.com>.
Where did you add this Regular Expression Extractor?
Try to use it, only, inside the sampler with the desired json response and
not out of it.
JMeter Test Plan is hierarchical and, if you add the Regex Ext just bellow
a Logic Controller, it will repeat the test in every sampler inside the
grouping controller.

I also tested your regex and seams fine to me.
Although, I have some tips on it.
You could use one of the examples bellow (and many more if you want) in
order to reduce the overall load of the dotted regex

\\"Status\\":\\"([A-Z]+?)\\"  --> work only for upper case letters
\\"Status\\":\\"([a-zA-Z]+?)\\"   -> work for complete, COMPLETE or any
other variant with upper and/or lower case letters
\\"Status\\":\\"(\w+?)\\"  --> work with any compound of a-z, A-Z, 0-9 and
_ (underscore) characters

I have striped the commas because this way your Status attribute could be
in any part of your json object structure.

Hope it helps you.
Flávio Cysne

2012/5/28 venkatakurathi <ve...@hotmail.com>

> Hi All,
>
> i am facing an problem with extracting the required string from response.
> the below is the response
>
> "jobId\":\"32c1919e-a8c3-11e1-9220-00163e7f6087\",\"Status\":\"COMPLETED\",\"Percentage\":100}')"}
>
>
> i need to get the status completed(until then the loop runs)
>
> the regexp i used :
>
> \\",\\"Status\\":\\"(.+?)\\",\\"
>
> when i checked it with regexp tester it is showing the output.
>
> during run time i added debug sampler to check the values we are
> capturing....then is showin my default value "ERROR".
>
> can some one assist me in why this difference b/w regexp tester and debug
> sampler.
>
> what could be the proper regular expression to extract the string?
>
> -----
> Venkat Akurathi
> 91-9703186688
> --
> View this message in context:
> http://jmeter.512774.n5.nabble.com/need-help-with-regular-expression-regexp-tester-tp5713371.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>