You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Shaba K <sh...@gmail.com> on 2011/11/25 11:08:21 UTC

Extracting from JSON using Regular expression Extrator

Hi All,

I am stuck with getting this extraction right

here's my JSON snippet

{
:
"params":"authp=nonce.style&style=mock&nonce=T3LOmVN6YMl4KZGTJTyOJholMQ0&psig=MnJNx0_iWJfADsh7C5-IbwCLfZM",
:   "type":"reCAPTCHA",
:   "public_key":"6LciS7oSAAAAAG8P5umXg9j_65IsvR1lboEYaqJ-",
:   "server":"https://www.google.com/recaptcha/api",
:   "command":"create_captcha"
}


i need to extract value of nonce & psig


am passing

nonce
"params":"(.+?)"
$1$
-1
REGEX_FAILED

Am bit of no vice on Reg extractor.

Re: Extracting from JSON using Regular expression Extrator

Posted by Deepak Shetty <sh...@gmail.com>.
>This is first time I have seen someone telling me that they can mock
captchas.Fantastic stuff.
Not if you can make changes on the server side (for e.g. a URL that tells
returns the captcha value that Jmeter can use or a flag in the application
that can be used to disable the check).


regards
deepak


On Fri, Nov 25, 2011 at 3:56 PM, kiran <ki...@yahoo.com> wrote:

> Shaba,
>
> I think its great news that you are able to successfully mock it.This is
> first time I have seen someone telling me that they can mock
> captchas.Fantastic stuff.
>
> Just to confirm it once again, how does your thread or jmeter script read
> the text and input it in the input box given that for every hit, you are
> going to get different image with different text in it.The path what you
> are trying to capture contains the encrypted image with text in it.How are
> retriving that text ?
>
> As far as I know google captchas are not native JS + Image solutions,
> infact they are only image with Text in it and this is single resource
> which is validated at server side with serverside key(I think google gives
> you the key once your register for it.).
>
> If you are able to mock it , you wanna talk to google and inform this.Its
> huge gap in their apis.
> What google recaptchas api does your app use, PHP/JAVA/JS or some thing
> else ?
>
>
> With Regards,
> Kiran Badi
> Email:kiranbadi@yahoo.com
>
>
> ________________________________
>  From: Shaba K <sh...@gmail.com>
> To: JMeter Users List <us...@jmeter.apache.org>
> Sent: Saturday, November 26, 2011 1:57 AM
> Subject: Re: Extracting from JSON using Regular expression Extrator
>
> @Oliver/@Kiran :
>
> It is indeed Captcha
>
> We are mocking this.
>
> It works absolutely fine.
>
> -Shabana
>
> On Fri, Nov 25, 2011 at 6:58 PM, Oliver Lloyd <oliver_lloyd@hotmail.com
> >wrote:
>
> > You do realise that the entire purpose of captchas is to prevent people
> > like
> > you using tools like JMeter to automate against the page that the captcha
> > sits on, right? (Google's recaptcha has other uses but putting that aside
> > for now). Because it does kind of seem like you are trying to automate
> > catpcha responses here, which is never going to work because JMeter is
> not
> > human and cannot read obfuscated text. And no, Kiran, he has not broken
> the
> > captcha by successfully writing the first AI JMeter script - he seems to
> be
> > giving it a go though.
> >
> > Now, if you just want to load the captcha and don't care about submitting
> > the correct response then ignore what I just wrote but, er, why? Do you
> > work
> > for Google? You should only be testing your own code and not spamming
> > Google's recaptcha service.
> >
> > Look, just disable the captcha during your testing, it will save you
> rather
> > a lot of time. You can either do that or another alternative might be to
> > load the image but not require that the submitted text be validated - not
> > sure if this is possible with this service but it's worthwhile if it is
> > because I have seen bottlenecks on the captcha load request before where
> > our
> > captcha framework code had a bug in it so it is a potential area where
> > issue
> > can occur.
> >
> > -----
> > http://www.http503.com/
> > --
> > View this message in context:
> >
> http://jmeter.512774.n5.nabble.com/Extracting-from-JSON-using-Regular-expression-Extrator-tp5022431p5023505.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: Extracting from JSON using Regular expression Extrator

Posted by Shaba K <sh...@gmail.com>.
Sory , for not being clear about mocking.

We have made a config such that irrespective of the text displayed in the
image.
a default value entered in text box will verify our signature,



On Fri, Nov 25, 2011 at 11:56 PM, kiran <ki...@yahoo.com> wrote:

> Shaba,
>
> I think its great news that you are able to successfully mock it.This is
> first time I have seen someone telling me that they can mock
> captchas.Fantastic stuff.
>
> Just to confirm it once again, how does your thread or jmeter script read
> the text and input it in the input box given that for every hit, you are
> going to get different image with different text in it.The path what you
> are trying to capture contains the encrypted image with text in it.How are
> retriving that text ?
>
> As far as I know google captchas are not native JS + Image solutions,
> infact they are only image with Text in it and this is single resource
> which is validated at server side with serverside key(I think google gives
> you the key once your register for it.).
>
> If you are able to mock it , you wanna talk to google and inform this.Its
> huge gap in their apis.
> What google recaptchas api does your app use, PHP/JAVA/JS or some thing
> else ?
>
>
> With Regards,
> Kiran Badi
> Email:kiranbadi@yahoo.com
>
>
> ________________________________
>  From: Shaba K <sh...@gmail.com>
> To: JMeter Users List <us...@jmeter.apache.org>
> Sent: Saturday, November 26, 2011 1:57 AM
> Subject: Re: Extracting from JSON using Regular expression Extrator
>
> @Oliver/@Kiran :
>
> It is indeed Captcha
>
> We are mocking this.
>
> It works absolutely fine.
>
> -Shabana
>
> On Fri, Nov 25, 2011 at 6:58 PM, Oliver Lloyd <oliver_lloyd@hotmail.com
> >wrote:
>
> > You do realise that the entire purpose of captchas is to prevent people
> > like
> > you using tools like JMeter to automate against the page that the captcha
> > sits on, right? (Google's recaptcha has other uses but putting that aside
> > for now). Because it does kind of seem like you are trying to automate
> > catpcha responses here, which is never going to work because JMeter is
> not
> > human and cannot read obfuscated text. And no, Kiran, he has not broken
> the
> > captcha by successfully writing the first AI JMeter script - he seems to
> be
> > giving it a go though.
> >
> > Now, if you just want to load the captcha and don't care about submitting
> > the correct response then ignore what I just wrote but, er, why? Do you
> > work
> > for Google? You should only be testing your own code and not spamming
> > Google's recaptcha service.
> >
> > Look, just disable the captcha during your testing, it will save you
> rather
> > a lot of time. You can either do that or another alternative might be to
> > load the image but not require that the submitted text be validated - not
> > sure if this is possible with this service but it's worthwhile if it is
> > because I have seen bottlenecks on the captcha load request before where
> > our
> > captcha framework code had a bug in it so it is a potential area where
> > issue
> > can occur.
> >
> > -----
> > http://www.http503.com/
> > --
> > View this message in context:
> >
> http://jmeter.512774.n5.nabble.com/Extracting-from-JSON-using-Regular-expression-Extrator-tp5022431p5023505.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: Extracting from JSON using Regular expression Extrator

Posted by kiran <ki...@yahoo.com>.
Shaba, 
 
I think its great news that you are able to successfully mock it.This is first time I have seen someone telling me that they can mock captchas.Fantastic stuff.
 
Just to confirm it once again, how does your thread or jmeter script read the text and input it in the input box given that for every hit, you are going to get different image with different text in it.The path what you are trying to capture contains the encrypted image with text in it.How are retriving that text ? 
 
As far as I know google captchas are not native JS + Image solutions, infact they are only image with Text in it and this is single resource which is validated at server side with serverside key(I think google gives you the key once your register for it.).
 
If you are able to mock it , you wanna talk to google and inform this.Its huge gap in their apis.
What google recaptchas api does your app use, PHP/JAVA/JS or some thing else ?
 
 
With Regards,
Kiran Badi
Email:kiranbadi@yahoo.com
 

________________________________
 From: Shaba K <sh...@gmail.com>
To: JMeter Users List <us...@jmeter.apache.org> 
Sent: Saturday, November 26, 2011 1:57 AM
Subject: Re: Extracting from JSON using Regular expression Extrator
 
@Oliver/@Kiran :

It is indeed Captcha

We are mocking this.

It works absolutely fine.

-Shabana

On Fri, Nov 25, 2011 at 6:58 PM, Oliver Lloyd <ol...@hotmail.com>wrote:

> You do realise that the entire purpose of captchas is to prevent people
> like
> you using tools like JMeter to automate against the page that the captcha
> sits on, right? (Google's recaptcha has other uses but putting that aside
> for now). Because it does kind of seem like you are trying to automate
> catpcha responses here, which is never going to work because JMeter is not
> human and cannot read obfuscated text. And no, Kiran, he has not broken the
> captcha by successfully writing the first AI JMeter script - he seems to be
> giving it a go though.
>
> Now, if you just want to load the captcha and don't care about submitting
> the correct response then ignore what I just wrote but, er, why? Do you
> work
> for Google? You should only be testing your own code and not spamming
> Google's recaptcha service.
>
> Look, just disable the captcha during your testing, it will save you rather
> a lot of time. You can either do that or another alternative might be to
> load the image but not require that the submitted text be validated - not
> sure if this is possible with this service but it's worthwhile if it is
> because I have seen bottlenecks on the captcha load request before where
> our
> captcha framework code had a bug in it so it is a potential area where
> issue
> can occur.
>
> -----
> http://www.http503.com/
> --
> View this message in context:
> http://jmeter.512774.n5.nabble.com/Extracting-from-JSON-using-Regular-expression-Extrator-tp5022431p5023505.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: Extracting from JSON using Regular expression Extrator

Posted by Shaba K <sh...@gmail.com>.
@Oliver/@Kiran :

It is indeed Captcha

We are mocking this.

It works absolutely fine.

-Shabana

On Fri, Nov 25, 2011 at 6:58 PM, Oliver Lloyd <ol...@hotmail.com>wrote:

> You do realise that the entire purpose of captchas is to prevent people
> like
> you using tools like JMeter to automate against the page that the captcha
> sits on, right? (Google's recaptcha has other uses but putting that aside
> for now). Because it does kind of seem like you are trying to automate
> catpcha responses here, which is never going to work because JMeter is not
> human and cannot read obfuscated text. And no, Kiran, he has not broken the
> captcha by successfully writing the first AI JMeter script - he seems to be
> giving it a go though.
>
> Now, if you just want to load the captcha and don't care about submitting
> the correct response then ignore what I just wrote but, er, why? Do you
> work
> for Google? You should only be testing your own code and not spamming
> Google's recaptcha service.
>
> Look, just disable the captcha during your testing, it will save you rather
> a lot of time. You can either do that or another alternative might be to
> load the image but not require that the submitted text be validated - not
> sure if this is possible with this service but it's worthwhile if it is
> because I have seen bottlenecks on the captcha load request before where
> our
> captcha framework code had a bug in it so it is a potential area where
> issue
> can occur.
>
> -----
> http://www.http503.com/
> --
> View this message in context:
> http://jmeter.512774.n5.nabble.com/Extracting-from-JSON-using-Regular-expression-Extrator-tp5022431p5023505.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: Extracting from JSON using Regular expression Extrator

Posted by kiran <ki...@yahoo.com>.
Oliver,
 
I really hope so he has not broken it, but again he has to check and confirm it if his requests are indeed hitting in the backend servers or the only other thing I might here is that google might be providing some static captchas images for testing purposes.(I really doubt this since from past couple of weeks i have done some extensive research on implementing various capchas stuff and its performance impacts).
The way google capctcha are designed is that they have million of images with some funny text in it and and those images keep changing at every refresh.You can check this via fiddler or some tool.just click refresh button in that image placeholder,you can see it.It generates a post request.Pretty hard stuff to hack.

With Regards,
Kiran Badi
Email:kiranbadi@yahoo.com

________________________________
 From: Oliver Lloyd <ol...@hotmail.com>
To: jmeter-user@jakarta.apache.org 
Sent: Saturday, November 26, 2011 12:28 AM
Subject: Re: Extracting from JSON using Regular expression Extrator
 
You do realise that the entire purpose of captchas is to prevent people like
you using tools like JMeter to automate against the page that the captcha
sits on, right? (Google's recaptcha has other uses but putting that aside
for now). Because it does kind of seem like you are trying to automate
catpcha responses here, which is never going to work because JMeter is not
human and cannot read obfuscated text. And no, Kiran, he has not broken the
captcha by successfully writing the first AI JMeter script - he seems to be
giving it a go though.

Now, if you just want to load the captcha and don't care about submitting
the correct response then ignore what I just wrote but, er, why? Do you work
for Google? You should only be testing your own code and not spamming
Google's recaptcha service.

Look, just disable the captcha during your testing, it will save you rather
a lot of time. You can either do that or another alternative might be to
load the image but not require that the submitted text be validated - not
sure if this is possible with this service but it's worthwhile if it is
because I have seen bottlenecks on the captcha load request before where our
captcha framework code had a bug in it so it is a potential area where issue
can occur.

-----
http://www.http503.com/
--
View this message in context: http://jmeter.512774.n5.nabble.com/Extracting-from-JSON-using-Regular-expression-Extrator-tp5022431p5023505.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: Extracting from JSON using Regular expression Extrator

Posted by Oliver Lloyd <ol...@hotmail.com>.
You do realise that the entire purpose of captchas is to prevent people like
you using tools like JMeter to automate against the page that the captcha
sits on, right? (Google's recaptcha has other uses but putting that aside
for now). Because it does kind of seem like you are trying to automate
catpcha responses here, which is never going to work because JMeter is not
human and cannot read obfuscated text. And no, Kiran, he has not broken the
captcha by successfully writing the first AI JMeter script - he seems to be
giving it a go though.

Now, if you just want to load the captcha and don't care about submitting
the correct response then ignore what I just wrote but, er, why? Do you work
for Google? You should only be testing your own code and not spamming
Google's recaptcha service.

Look, just disable the captcha during your testing, it will save you rather
a lot of time. You can either do that or another alternative might be to
load the image but not require that the submitted text be validated - not
sure if this is possible with this service but it's worthwhile if it is
because I have seen bottlenecks on the captcha load request before where our
captcha framework code had a bug in it so it is a potential area where issue
can occur.

-----
http://www.http503.com/
--
View this message in context: http://jmeter.512774.n5.nabble.com/Extracting-from-JSON-using-Regular-expression-Extrator-tp5022431p5023505.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: Extracting from JSON using Regular expression Extrator

Posted by kiran <ki...@yahoo.com>.
Are we discussing here that JMeter can break google captchas which loads different image for every refresh ?
 
Has anyone this before ?

With Regards,
Kiran Badi
Email:kiranbadi@yahoo.com
 

________________________________
 From: Shaba K <sh...@gmail.com>
To: JMeter Users List <us...@jmeter.apache.org> 
Sent: Friday, November 25, 2011 4:53 PM
Subject: Re: Extracting from JSON using Regular expression Extrator
 
var RecaptchaState = {
    site : '6LciS7oSAAAAAG8P5umXg9j_
65IsvR1lboEYaqJ-',
    challenge :
'03AHJ_VusWGO5_rL3ad5mK_dHhDPvCwmqZ56hSjSADoWFvTlucNbOChro_G6FluObzthCiQvZx6o3BgT2GKY-nBFbPJZM2kzIX-_G4jz4igbQPoDc7A8uxwqQi4ncg6f06QRk8pRFC0LCWHSfpGVHBaCSYTipZxHs78w',
    is_incorrect : false,
    programming_error : '',
    error_message : '',
    server : 'https://www.google.com/recaptcha/api/',
    timeout : 18000
};


On Fri, Nov 25, 2011 at 11:18 AM, Felix Frank <ff...@mpexnet.de> wrote:

> What's with all the quotes? I don't see any in your input.
>
> Try regex
>
> challenge : '(.+?)'
>
> HTH,
> Felix
>
> On 11/25/2011 12:13 PM, Shaba K wrote:
> > This doesn't work either
> >
> > "RecaptchaState"="(.+?)challenge:(.+?)"
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

Re: Extracting from JSON using Regular expression Extrator

Posted by Shaba K <sh...@gmail.com>.
var RecaptchaState = {
    site : '6LciS7oSAAAAAG8P5umXg9j_
65IsvR1lboEYaqJ-',
    challenge :
'03AHJ_VusWGO5_rL3ad5mK_dHhDPvCwmqZ56hSjSADoWFvTlucNbOChro_G6FluObzthCiQvZx6o3BgT2GKY-nBFbPJZM2kzIX-_G4jz4igbQPoDc7A8uxwqQi4ncg6f06QRk8pRFC0LCWHSfpGVHBaCSYTipZxHs78w',
    is_incorrect : false,
    programming_error : '',
    error_message : '',
    server : 'https://www.google.com/recaptcha/api/',
    timeout : 18000
};


On Fri, Nov 25, 2011 at 11:18 AM, Felix Frank <ff...@mpexnet.de> wrote:

> What's with all the quotes? I don't see any in your input.
>
> Try regex
>
> challenge : '(.+?)'
>
> HTH,
> Felix
>
> On 11/25/2011 12:13 PM, Shaba K wrote:
> > This doesn't work either
> >
> > "RecaptchaState"="(.+?)challenge:(.+?)"
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

Re: Extracting from JSON using Regular expression Extrator

Posted by Felix Frank <ff...@mpexnet.de>.
What's with all the quotes? I don't see any in your input.

Try regex

challenge : '(.+?)'

HTH,
Felix

On 11/25/2011 12:13 PM, Shaba K wrote:
> This doesn't work either
> 
> "RecaptchaState"="(.+?)challenge:(.+?)"

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


Re: Extracting from JSON using Regular expression Extrator

Posted by Shaba K <sh...@gmail.com>.
This doesn't work either

"RecaptchaState"="(.+?)challenge:(.+?)"


On Fri, Nov 25, 2011 at 11:10 AM, Shaba K <sh...@gmail.com> wrote:

> Hi Again,
>
> I have a JSOn response as
>
>
> var RecaptchaState = {
>     site : '6LciS7oSAAAAAG8P5umXg9j_65IsvR1lboEYaqJ-',
>     challenge :
> '03AHJ_VusWGO5_rL3ad5mK_dHhDPvCwmqZ56hSjSADoWFvTlucNbOChro_G6FluObzthCiQvZx6o3BgT2GKY-nBFbPJZM2kzIX-_G4jz4igbQPoDc7A8uxwqQi4ncg6f06QRk8pRFC0LCWHSfpGVHBaCSYTipZxHs78w',
>     is_incorrect : false,
>     programming_error : '',
>     error_message : '',
>     server : 'https://www.google.com/recaptcha/api/',
>     timeout : 18000
> };
>
>
> i am using a reg exp as "challenge":"(.+?)"
>
> I am seeing no results ..
>
> How is this different ??
>
> -Shaba
>
>
> On Fri, Nov 25, 2011 at 11:04 AM, Shaba K <sh...@gmail.com> wrote:
>
>> I was passing as ${EXTRACTED_VALUES_g_2}
>>
>> Cheers,
>> Shaba
>>
>>
>>
>>
>>
>>
>>
>> On Fri, Nov 25, 2011 at 10:41 AM, Nermin CALUK <ne...@atlantbh.com>wrote:
>>
>>> So your regex extractor setup will look like this:
>>>
>>>  Reference Name: EXTRACTEDVALUES
>>>  Regular Expression: "params":"(.+?)nonce=(.+?)&psig=(.+?)"
>>>  Template: $1$$2$$3$
>>>  Match No: 1
>>>  Default Value: REGEX_FAILED
>>>
>>> Then your debug sampler will show:
>>>
>>>  ...
>>>  EXTRACTEDVALUES_g2=T3LOmVN6YMl4KZGTJTyOJholMQ0
>>>  EXTRACTEDVALUES_g3=MnJNx0_iWJfADsh7C5-IbwCLfZM
>>>  ...
>>>
>>> Therefore you will use the following variables in next step:
>>>
>>>  ${EXTRACTEDVALUES_g2}
>>>  ${EXTRACTEDVALUES_g3}
>>>
>>>
>>> Cheers
>>> Nermin
>>>
>>>
>>> -----Original Message-----
>>> From: Shaba K [mailto:shabazia09@gmail.com]
>>> Sent: Friday, November 25, 2011 11:36 AM
>>> To: JMeter Users List
>>> Subject: Re: Extracting from JSON using Regular expression Extrator
>>>
>>> Thanks Nermin,
>>>
>>> Now got my head around how to pass
>>>
>>> This returns
>>>
>>> Match count: 1
>>>
>>> Match[1][0]="params":"authp=nonce.style&style=mock&nonce=J6p_d26Ou_gDxxeOECH
>>> VwGZu3So&psig=9J0njCeWnb1z9JC-LVHDJH5eMtM"
>>> Match[1][1]=authp=nonce.style&style=mock&
>>> Match[1][2]=J6p_d26Ou_gDxxeOECHVwGZu3So
>>> Match[1][3]=9J0njCeWnb1z9JC-LVHDJH5eMtM
>>>
>>> I have to use the values retrived in Match[1][2] & Match[1][3] from this
>>> response & pass as a request to another
>>>
>>> Am passing as
>>>
>>>
>>> k=${PUBLIC_KEY}&ajax=1&cachestop=0.6243942725806035&authp=nonce.style&style=
>>> mock&nonce=${PUBLIC_KEY_g_2}&psig=niY9QRuXgso7xsst2cgRtxvIW2w
>>>
>>>
>>> All my attempts are failing !!!
>>>
>>> -Shaba
>>> On Fri, Nov 25, 2011 at 10:27 AM, Nermin CALUK <ne...@atlantbh.com>
>>> wrote:
>>>
>>> > Shaba,
>>> >
>>> > Try something like this "params":"(.+?)nonce=(.+?)&psig=(.+?)"
>>> >
>>> > Second group will extract value of nonce, third group will contain psig
>>> >
>>> > Use debug sampler and "regexpr tester" in view results tree for
>>> debugging
>>> >
>>> > Nermin
>>> >
>>> > -----Original Message-----
>>> > From: Shaba K [mailto:shabazia09@gmail.com]
>>> > Sent: Friday, November 25, 2011 11:16 AM
>>> > To: JMeter Users List
>>> > Subject: Re: Extracting from JSON using Regular expression Extrator
>>> >
>>> > i see the value returned is REGEX_FAILED
>>> >
>>> > On Fri, Nov 25, 2011 at 10:08 AM, Shaba K <sh...@gmail.com>
>>> wrote:
>>> >
>>> > > Hi All,
>>> > >
>>> > > I am stuck with getting this extraction right
>>> > >
>>> > > here's my JSON snippet
>>> > >
>>> > > {
>>> > > :
>>> > >
>>> >
>>> >
>>>
>>> "params":"authp=nonce.style&style=mock&nonce=T3LOmVN6YMl4KZGTJTyOJholMQ0&psi
>>> > g=MnJNx0_iWJfADsh7C5-IbwCLfZM",
>>> > > :   "type":"reCAPTCHA",
>>> > > :   "public_key":"6LciS7oSAAAAAG8P5umXg9j_65IsvR1lboEYaqJ-",
>>> > > :   "server":"https://www.google.com/recaptcha/api",
>>> > > :   "command":"create_captcha"
>>> > > }
>>> > >
>>> > >
>>> > > i need to extract value of nonce & psig
>>> > >
>>> > >
>>> > > am passing
>>> > >
>>> > > nonce
>>> > > "params":"(.+?)"
>>> > > $1$
>>> > > -1
>>> > > REGEX_FAILED
>>> > >
>>> > > Am bit of no vice on Reg extractor.
>>> > >
>>> > >
>>> > >
>>> >
>>> >
>>> > ---------------------------------------------------------------------
>>> > To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>>> > For additional commands, e-mail: user-help@jmeter.apache.org
>>> >
>>> >
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>>> For additional commands, e-mail: user-help@jmeter.apache.org
>>>
>>>
>>
>

Re: Extracting from JSON using Regular expression Extrator

Posted by Shaba K <sh...@gmail.com>.
Hi Again,

I have a JSOn response as


var RecaptchaState = {
    site : '6LciS7oSAAAAAG8P5umXg9j_65IsvR1lboEYaqJ-',
    challenge :
'03AHJ_VusWGO5_rL3ad5mK_dHhDPvCwmqZ56hSjSADoWFvTlucNbOChro_G6FluObzthCiQvZx6o3BgT2GKY-nBFbPJZM2kzIX-_G4jz4igbQPoDc7A8uxwqQi4ncg6f06QRk8pRFC0LCWHSfpGVHBaCSYTipZxHs78w',
    is_incorrect : false,
    programming_error : '',
    error_message : '',
    server : 'https://www.google.com/recaptcha/api/',
    timeout : 18000
};


i am using a reg exp as "challenge":"(.+?)"

I am seeing no results ..

How is this different ??

-Shaba

On Fri, Nov 25, 2011 at 11:04 AM, Shaba K <sh...@gmail.com> wrote:

> I was passing as ${EXTRACTED_VALUES_g_2}
>
> Cheers,
> Shaba
>
>
>
>
>
>
>
> On Fri, Nov 25, 2011 at 10:41 AM, Nermin CALUK <ne...@atlantbh.com>wrote:
>
>> So your regex extractor setup will look like this:
>>
>>  Reference Name: EXTRACTEDVALUES
>>  Regular Expression: "params":"(.+?)nonce=(.+?)&psig=(.+?)"
>>  Template: $1$$2$$3$
>>  Match No: 1
>>  Default Value: REGEX_FAILED
>>
>> Then your debug sampler will show:
>>
>>  ...
>>  EXTRACTEDVALUES_g2=T3LOmVN6YMl4KZGTJTyOJholMQ0
>>  EXTRACTEDVALUES_g3=MnJNx0_iWJfADsh7C5-IbwCLfZM
>>  ...
>>
>> Therefore you will use the following variables in next step:
>>
>>  ${EXTRACTEDVALUES_g2}
>>  ${EXTRACTEDVALUES_g3}
>>
>>
>> Cheers
>> Nermin
>>
>>
>> -----Original Message-----
>> From: Shaba K [mailto:shabazia09@gmail.com]
>> Sent: Friday, November 25, 2011 11:36 AM
>> To: JMeter Users List
>> Subject: Re: Extracting from JSON using Regular expression Extrator
>>
>> Thanks Nermin,
>>
>> Now got my head around how to pass
>>
>> This returns
>>
>> Match count: 1
>>
>> Match[1][0]="params":"authp=nonce.style&style=mock&nonce=J6p_d26Ou_gDxxeOECH
>> VwGZu3So&psig=9J0njCeWnb1z9JC-LVHDJH5eMtM"
>> Match[1][1]=authp=nonce.style&style=mock&
>> Match[1][2]=J6p_d26Ou_gDxxeOECHVwGZu3So
>> Match[1][3]=9J0njCeWnb1z9JC-LVHDJH5eMtM
>>
>> I have to use the values retrived in Match[1][2] & Match[1][3] from this
>> response & pass as a request to another
>>
>> Am passing as
>>
>>
>> k=${PUBLIC_KEY}&ajax=1&cachestop=0.6243942725806035&authp=nonce.style&style=
>> mock&nonce=${PUBLIC_KEY_g_2}&psig=niY9QRuXgso7xsst2cgRtxvIW2w
>>
>>
>> All my attempts are failing !!!
>>
>> -Shaba
>> On Fri, Nov 25, 2011 at 10:27 AM, Nermin CALUK <ne...@atlantbh.com>
>> wrote:
>>
>> > Shaba,
>> >
>> > Try something like this "params":"(.+?)nonce=(.+?)&psig=(.+?)"
>> >
>> > Second group will extract value of nonce, third group will contain psig
>> >
>> > Use debug sampler and "regexpr tester" in view results tree for
>> debugging
>> >
>> > Nermin
>> >
>> > -----Original Message-----
>> > From: Shaba K [mailto:shabazia09@gmail.com]
>> > Sent: Friday, November 25, 2011 11:16 AM
>> > To: JMeter Users List
>> > Subject: Re: Extracting from JSON using Regular expression Extrator
>> >
>> > i see the value returned is REGEX_FAILED
>> >
>> > On Fri, Nov 25, 2011 at 10:08 AM, Shaba K <sh...@gmail.com> wrote:
>> >
>> > > Hi All,
>> > >
>> > > I am stuck with getting this extraction right
>> > >
>> > > here's my JSON snippet
>> > >
>> > > {
>> > > :
>> > >
>> >
>> >
>>
>> "params":"authp=nonce.style&style=mock&nonce=T3LOmVN6YMl4KZGTJTyOJholMQ0&psi
>> > g=MnJNx0_iWJfADsh7C5-IbwCLfZM",
>> > > :   "type":"reCAPTCHA",
>> > > :   "public_key":"6LciS7oSAAAAAG8P5umXg9j_65IsvR1lboEYaqJ-",
>> > > :   "server":"https://www.google.com/recaptcha/api",
>> > > :   "command":"create_captcha"
>> > > }
>> > >
>> > >
>> > > i need to extract value of nonce & psig
>> > >
>> > >
>> > > am passing
>> > >
>> > > nonce
>> > > "params":"(.+?)"
>> > > $1$
>> > > -1
>> > > REGEX_FAILED
>> > >
>> > > Am bit of no vice on Reg extractor.
>> > >
>> > >
>> > >
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>> > For additional commands, e-mail: user-help@jmeter.apache.org
>> >
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>> For additional commands, e-mail: user-help@jmeter.apache.org
>>
>>
>

Re: Extracting from JSON using Regular expression Extrator

Posted by Shaba K <sh...@gmail.com>.
I was passing as ${EXTRACTED_VALUES_g_2}

Cheers,
Shaba






On Fri, Nov 25, 2011 at 10:41 AM, Nermin CALUK <ne...@atlantbh.com> wrote:

> So your regex extractor setup will look like this:
>
>  Reference Name: EXTRACTEDVALUES
>  Regular Expression: "params":"(.+?)nonce=(.+?)&psig=(.+?)"
>  Template: $1$$2$$3$
>  Match No: 1
>  Default Value: REGEX_FAILED
>
> Then your debug sampler will show:
>
>  ...
>  EXTRACTEDVALUES_g2=T3LOmVN6YMl4KZGTJTyOJholMQ0
>  EXTRACTEDVALUES_g3=MnJNx0_iWJfADsh7C5-IbwCLfZM
>  ...
>
> Therefore you will use the following variables in next step:
>
>  ${EXTRACTEDVALUES_g2}
>  ${EXTRACTEDVALUES_g3}
>
>
> Cheers
> Nermin
>
>
> -----Original Message-----
> From: Shaba K [mailto:shabazia09@gmail.com]
> Sent: Friday, November 25, 2011 11:36 AM
> To: JMeter Users List
> Subject: Re: Extracting from JSON using Regular expression Extrator
>
> Thanks Nermin,
>
> Now got my head around how to pass
>
> This returns
>
> Match count: 1
>
> Match[1][0]="params":"authp=nonce.style&style=mock&nonce=J6p_d26Ou_gDxxeOECH
> VwGZu3So&psig=9J0njCeWnb1z9JC-LVHDJH5eMtM"
> Match[1][1]=authp=nonce.style&style=mock&
> Match[1][2]=J6p_d26Ou_gDxxeOECHVwGZu3So
> Match[1][3]=9J0njCeWnb1z9JC-LVHDJH5eMtM
>
> I have to use the values retrived in Match[1][2] & Match[1][3] from this
> response & pass as a request to another
>
> Am passing as
>
>
> k=${PUBLIC_KEY}&ajax=1&cachestop=0.6243942725806035&authp=nonce.style&style=
> mock&nonce=${PUBLIC_KEY_g_2}&psig=niY9QRuXgso7xsst2cgRtxvIW2w
>
>
> All my attempts are failing !!!
>
> -Shaba
> On Fri, Nov 25, 2011 at 10:27 AM, Nermin CALUK <ne...@atlantbh.com>
> wrote:
>
> > Shaba,
> >
> > Try something like this "params":"(.+?)nonce=(.+?)&psig=(.+?)"
> >
> > Second group will extract value of nonce, third group will contain psig
> >
> > Use debug sampler and "regexpr tester" in view results tree for debugging
> >
> > Nermin
> >
> > -----Original Message-----
> > From: Shaba K [mailto:shabazia09@gmail.com]
> > Sent: Friday, November 25, 2011 11:16 AM
> > To: JMeter Users List
> > Subject: Re: Extracting from JSON using Regular expression Extrator
> >
> > i see the value returned is REGEX_FAILED
> >
> > On Fri, Nov 25, 2011 at 10:08 AM, Shaba K <sh...@gmail.com> wrote:
> >
> > > Hi All,
> > >
> > > I am stuck with getting this extraction right
> > >
> > > here's my JSON snippet
> > >
> > > {
> > > :
> > >
> >
> >
>
> "params":"authp=nonce.style&style=mock&nonce=T3LOmVN6YMl4KZGTJTyOJholMQ0&psi
> > g=MnJNx0_iWJfADsh7C5-IbwCLfZM",
> > > :   "type":"reCAPTCHA",
> > > :   "public_key":"6LciS7oSAAAAAG8P5umXg9j_65IsvR1lboEYaqJ-",
> > > :   "server":"https://www.google.com/recaptcha/api",
> > > :   "command":"create_captcha"
> > > }
> > >
> > >
> > > i need to extract value of nonce & psig
> > >
> > >
> > > am passing
> > >
> > > nonce
> > > "params":"(.+?)"
> > > $1$
> > > -1
> > > REGEX_FAILED
> > >
> > > Am bit of no vice on Reg extractor.
> > >
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> > For additional commands, e-mail: user-help@jmeter.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

RE: Extracting from JSON using Regular expression Extrator

Posted by Nermin CALUK <ne...@atlantbh.com>.
So your regex extractor setup will look like this:

  Reference Name: EXTRACTEDVALUES
  Regular Expression: "params":"(.+?)nonce=(.+?)&psig=(.+?)"
  Template: $1$$2$$3$
  Match No: 1
  Default Value: REGEX_FAILED

Then your debug sampler will show:

  ...
  EXTRACTEDVALUES_g2=T3LOmVN6YMl4KZGTJTyOJholMQ0
  EXTRACTEDVALUES_g3=MnJNx0_iWJfADsh7C5-IbwCLfZM
  ...

Therefore you will use the following variables in next step:

  ${EXTRACTEDVALUES_g2}
  ${EXTRACTEDVALUES_g3}


Cheers
Nermin


-----Original Message-----
From: Shaba K [mailto:shabazia09@gmail.com] 
Sent: Friday, November 25, 2011 11:36 AM
To: JMeter Users List
Subject: Re: Extracting from JSON using Regular expression Extrator

Thanks Nermin,

Now got my head around how to pass

This returns

Match count: 1
Match[1][0]="params":"authp=nonce.style&style=mock&nonce=J6p_d26Ou_gDxxeOECH
VwGZu3So&psig=9J0njCeWnb1z9JC-LVHDJH5eMtM"
Match[1][1]=authp=nonce.style&style=mock&
Match[1][2]=J6p_d26Ou_gDxxeOECHVwGZu3So
Match[1][3]=9J0njCeWnb1z9JC-LVHDJH5eMtM

I have to use the values retrived in Match[1][2] & Match[1][3] from this
response & pass as a request to another

Am passing as

k=${PUBLIC_KEY}&ajax=1&cachestop=0.6243942725806035&authp=nonce.style&style=
mock&nonce=${PUBLIC_KEY_g_2}&psig=niY9QRuXgso7xsst2cgRtxvIW2w


All my attempts are failing !!!

-Shaba
On Fri, Nov 25, 2011 at 10:27 AM, Nermin CALUK <ne...@atlantbh.com> wrote:

> Shaba,
>
> Try something like this "params":"(.+?)nonce=(.+?)&psig=(.+?)"
>
> Second group will extract value of nonce, third group will contain psig
>
> Use debug sampler and "regexpr tester" in view results tree for debugging
>
> Nermin
>
> -----Original Message-----
> From: Shaba K [mailto:shabazia09@gmail.com]
> Sent: Friday, November 25, 2011 11:16 AM
> To: JMeter Users List
> Subject: Re: Extracting from JSON using Regular expression Extrator
>
> i see the value returned is REGEX_FAILED
>
> On Fri, Nov 25, 2011 at 10:08 AM, Shaba K <sh...@gmail.com> wrote:
>
> > Hi All,
> >
> > I am stuck with getting this extraction right
> >
> > here's my JSON snippet
> >
> > {
> > :
> >
>
>
"params":"authp=nonce.style&style=mock&nonce=T3LOmVN6YMl4KZGTJTyOJholMQ0&psi
> g=MnJNx0_iWJfADsh7C5-IbwCLfZM",
> > :   "type":"reCAPTCHA",
> > :   "public_key":"6LciS7oSAAAAAG8P5umXg9j_65IsvR1lboEYaqJ-",
> > :   "server":"https://www.google.com/recaptcha/api",
> > :   "command":"create_captcha"
> > }
> >
> >
> > i need to extract value of nonce & psig
> >
> >
> > am passing
> >
> > nonce
> > "params":"(.+?)"
> > $1$
> > -1
> > REGEX_FAILED
> >
> > Am bit of no vice on Reg extractor.
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>


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


Re: Extracting from JSON using Regular expression Extrator

Posted by Shaba K <sh...@gmail.com>.
Thanks Nermin,

Now got my head around how to pass

This returns

Match count: 1
Match[1][0]="params":"authp=nonce.style&style=mock&nonce=J6p_d26Ou_gDxxeOECHVwGZu3So&psig=9J0njCeWnb1z9JC-LVHDJH5eMtM"
Match[1][1]=authp=nonce.style&style=mock&
Match[1][2]=J6p_d26Ou_gDxxeOECHVwGZu3So
Match[1][3]=9J0njCeWnb1z9JC-LVHDJH5eMtM

I have to use the values retrived in Match[1][2] & Match[1][3] from this
response & pass as a request to another

Am passing as

k=${PUBLIC_KEY}&ajax=1&cachestop=0.6243942725806035&authp=nonce.style&style=mock&nonce=${PUBLIC_KEY_g_2}&psig=niY9QRuXgso7xsst2cgRtxvIW2w


All my attempts are failing !!!

-Shaba
On Fri, Nov 25, 2011 at 10:27 AM, Nermin CALUK <ne...@atlantbh.com> wrote:

> Shaba,
>
> Try something like this "params":"(.+?)nonce=(.+?)&psig=(.+?)"
>
> Second group will extract value of nonce, third group will contain psig
>
> Use debug sampler and "regexpr tester" in view results tree for debugging
>
> Nermin
>
> -----Original Message-----
> From: Shaba K [mailto:shabazia09@gmail.com]
> Sent: Friday, November 25, 2011 11:16 AM
> To: JMeter Users List
> Subject: Re: Extracting from JSON using Regular expression Extrator
>
> i see the value returned is REGEX_FAILED
>
> On Fri, Nov 25, 2011 at 10:08 AM, Shaba K <sh...@gmail.com> wrote:
>
> > Hi All,
> >
> > I am stuck with getting this extraction right
> >
> > here's my JSON snippet
> >
> > {
> > :
> >
>
> "params":"authp=nonce.style&style=mock&nonce=T3LOmVN6YMl4KZGTJTyOJholMQ0&psi
> g=MnJNx0_iWJfADsh7C5-IbwCLfZM",
> > :   "type":"reCAPTCHA",
> > :   "public_key":"6LciS7oSAAAAAG8P5umXg9j_65IsvR1lboEYaqJ-",
> > :   "server":"https://www.google.com/recaptcha/api",
> > :   "command":"create_captcha"
> > }
> >
> >
> > i need to extract value of nonce & psig
> >
> >
> > am passing
> >
> > nonce
> > "params":"(.+?)"
> > $1$
> > -1
> > REGEX_FAILED
> >
> > Am bit of no vice on Reg extractor.
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

RE: Extracting from JSON using Regular expression Extrator

Posted by Nermin CALUK <ne...@atlantbh.com>.
Shaba, 

Try something like this "params":"(.+?)nonce=(.+?)&psig=(.+?)"

Second group will extract value of nonce, third group will contain psig

Use debug sampler and "regexpr tester" in view results tree for debugging

Nermin

-----Original Message-----
From: Shaba K [mailto:shabazia09@gmail.com] 
Sent: Friday, November 25, 2011 11:16 AM
To: JMeter Users List
Subject: Re: Extracting from JSON using Regular expression Extrator

i see the value returned is REGEX_FAILED

On Fri, Nov 25, 2011 at 10:08 AM, Shaba K <sh...@gmail.com> wrote:

> Hi All,
>
> I am stuck with getting this extraction right
>
> here's my JSON snippet
>
> {
> :
>
"params":"authp=nonce.style&style=mock&nonce=T3LOmVN6YMl4KZGTJTyOJholMQ0&psi
g=MnJNx0_iWJfADsh7C5-IbwCLfZM",
> :   "type":"reCAPTCHA",
> :   "public_key":"6LciS7oSAAAAAG8P5umXg9j_65IsvR1lboEYaqJ-",
> :   "server":"https://www.google.com/recaptcha/api",
> :   "command":"create_captcha"
> }
>
>
> i need to extract value of nonce & psig
>
>
> am passing
>
> nonce
> "params":"(.+?)"
> $1$
> -1
> REGEX_FAILED
>
> Am bit of no vice on Reg extractor.
>
>
>


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


Re: Extracting from JSON using Regular expression Extrator

Posted by Shaba K <sh...@gmail.com>.
i see the value returned is REGEX_FAILED

On Fri, Nov 25, 2011 at 10:08 AM, Shaba K <sh...@gmail.com> wrote:

> Hi All,
>
> I am stuck with getting this extraction right
>
> here's my JSON snippet
>
> {
> :
> "params":"authp=nonce.style&style=mock&nonce=T3LOmVN6YMl4KZGTJTyOJholMQ0&psig=MnJNx0_iWJfADsh7C5-IbwCLfZM",
> :   "type":"reCAPTCHA",
> :   "public_key":"6LciS7oSAAAAAG8P5umXg9j_65IsvR1lboEYaqJ-",
> :   "server":"https://www.google.com/recaptcha/api",
> :   "command":"create_captcha"
> }
>
>
> i need to extract value of nonce & psig
>
>
> am passing
>
> nonce
> "params":"(.+?)"
> $1$
> -1
> REGEX_FAILED
>
> Am bit of no vice on Reg extractor.
>
>
>