You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Aaron Tracy <Aa...@octanner.com> on 2013/03/26 23:19:45 UTC

Regular Expression Extractor Returns Spaces instead of characters

Hi!

  I've got a regular expression ( content=\"([A-Za-z0-9!"#$%&'()*+,./:;<=>?@\^_`{|}~-]+)\" name="csrf-token ) That grabs my authentication token, the problem that I'm having is that when I use the variable that should have my authentication token that looks like this:

ELVM+rEgERKSGA4d9mld+PiMf1dRtub9wuuBE1rKflM=

Is stored in the variable and used in another request, the + and = are stripped from the token and

ELVM rEgERKSGA4d9mld PiMf1dRtub9wuuBE1rKflM

Is used instead which causes my script to break.  I've tried to wrap a function around it to replace all spaces with a + but that didn't work ( not to mention this doesn't handle the missing = ).  How do I escape the + and = characters so the variable retains the + and = signs?

Thank you!


RE: Regular Expression Extractor Returns Spaces instead of characters

Posted by Aaron Tracy <Aa...@octanner.com>.
After encoding, the bad session id ( ELVM rEgERKSGA4d9mld PiMf1dRtub9wuuBE1rKflM ) is sent back to the server side which then responds that the session isn't valid and returns a response of the login screen.

-----Original Message-----
From: Shay Ginsbourg [mailto:sginsbourg@gmail.com] 
Sent: Tuesday, March 26, 2013 4:35 PM
To: JMeter Users List
Subject: Re: Regular Expression Extractor Returns Spaces instead of characters

What happens after encoding the request that sends that variable back to the server side ?



On Wed, Mar 27, 2013 at 12:19 AM, Aaron Tracy <Aa...@octanner.com> wrote:
>
> Hi!
>
>   I've got a regular expression (
> content=\"([A-Za-z0-9!"#$%&'()*+,./:;<=>?@\^_`{|}~-]+)\" 
> name="csrf-token ) That grabs my authentication token, the problem 
> that I'm having is that when I use the variable that should have my 
> authentication token that looks like
> this:
>
> ELVM+rEgERKSGA4d9mld+PiMf1dRtub9wuuBE1rKflM=
>
> Is stored in the variable and used in another request, the + and = are 
> stripped from the token and
>
> ELVM rEgERKSGA4d9mld PiMf1dRtub9wuuBE1rKflM
>
> Is used instead which causes my script to break.  I've tried to wrap a 
> function around it to replace all spaces with a + but that didn't work 
> ( not to mention this doesn't handle the missing = ).  How do I escape 
> the + and = characters so the variable retains the + and = signs?
>
> Thank you!
>



--

Providing quality services to the highly appreciated customers:

* Applango.com * Arad Technologies Ltd * Astea Israel Ltd * BioControl Medical Ltd * Biometrix Ltd * Cognifit.com * Earlysense Ltd * Given Imaging Ltd * Idit Software Solutions * In-House * Israeli Ministry of Finance * Menora Insurance * Mentors Channel * Mominis.com * Ness Technologies * ORAM International * Partner-Orange * Peer39 * Physio-Logic Ltd * Pneumedicare Ltd * RealCommerce Ltd * Safecharge International * Shaker.com * Strauss-Water Tami4 * Tact-Matrix * TaKaDu.com * Tel-Aviv University * Tescom-ONE * TesTeam Ltd * Tuttnauer Ltd * Verix Ltd * Visionix Ltd * Visionsense Ltd * WinBuyer.com * XMPie-Xerox


Special notice:

In 2013, the entire operation of Ginsbourg.Com is being upgraded to cloud-based quality service.


Regards,


Shay Ginsbourg

Regulatory & Testing Affairs Consultant


WWW.GINSBOURG.COM


Providing Regulatory, Medical & Performance Testing services since 2008:

* IEC 62304 Medical Device Software Life Cycle * IEEE 829 Software Test Documentation * ISO 14971 Medical Device Risk Management * FDA 21 CFR Part
11 Software Validation * IEC 60601-1:2005 3rd ED PEMS - Medical Electrical Equipment * End-to-end verification, validation, and testing (VV&T) * FDA and CE submissions * Open source free testing tools implementation * Functionality and regression testing * Software Performance & Load testing * Software Testing Advanced Automation * Medical Software Verification & Validation * Medical Device Verification & Validation * Medical Device Regulatory Submission * Organizational Regulatory Qualification

Formerly QA Manager of LoadRunner at Mercury Interactive

M.Sc. cum laude in Bio-Medical Engineering

M.Sc. in Mechanical Engineering


Work:   +972(0)3-5185873

Mobile:  +972(0)54-6690915


Email: sginsbourg@gmail.com


Visit my personal page on LinkedIn at:
http://www.linkedin.com/in/shayginsbourg


Please consider your environmental responsibility before printing this e-mail.

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


Re: Regular Expression Extractor Returns Spaces instead of characters

Posted by Shay Ginsbourg <sg...@gmail.com>.
What happens after encoding the request that sends that variable back
to the server side ?



On Wed, Mar 27, 2013 at 12:19 AM, Aaron Tracy <Aa...@octanner.com> wrote:
>
> Hi!
>
>   I've got a regular expression (
> content=\"([A-Za-z0-9!"#$%&'()*+,./:;<=>?@\^_`{|}~-]+)\" name="csrf-token )
> That grabs my authentication token, the problem that I'm having is that when
> I use the variable that should have my authentication token that looks like
> this:
>
> ELVM+rEgERKSGA4d9mld+PiMf1dRtub9wuuBE1rKflM=
>
> Is stored in the variable and used in another request, the + and = are
> stripped from the token and
>
> ELVM rEgERKSGA4d9mld PiMf1dRtub9wuuBE1rKflM
>
> Is used instead which causes my script to break.  I've tried to wrap a
> function around it to replace all spaces with a + but that didn't work ( not
> to mention this doesn't handle the missing = ).  How do I escape the + and =
> characters so the variable retains the + and = signs?
>
> Thank you!
>



--

Providing quality services to the highly appreciated customers:

* Applango.com * Arad Technologies Ltd * Astea Israel Ltd * BioControl
Medical Ltd * Biometrix Ltd * Cognifit.com * Earlysense Ltd * Given Imaging
Ltd * Idit Software Solutions * In-House * Israeli Ministry of Finance *
Menora Insurance * Mentors Channel * Mominis.com * Ness Technologies * ORAM
International * Partner-Orange * Peer39 * Physio-Logic Ltd * Pneumedicare
Ltd * RealCommerce Ltd * Safecharge International * Shaker.com *
Strauss-Water Tami4 * Tact-Matrix * TaKaDu.com * Tel-Aviv University *
Tescom-ONE * TesTeam Ltd * Tuttnauer Ltd * Verix Ltd * Visionix Ltd *
Visionsense Ltd * WinBuyer.com * XMPie-Xerox


Special notice:

In 2013, the entire operation of Ginsbourg.Com is being upgraded to
cloud-based quality service.


Regards,


Shay Ginsbourg

Regulatory & Testing Affairs Consultant


WWW.GINSBOURG.COM


Providing Regulatory, Medical & Performance Testing services since 2008:

* IEC 62304 Medical Device Software Life Cycle * IEEE 829 Software Test
Documentation * ISO 14971 Medical Device Risk Management * FDA 21 CFR Part
11 Software Validation * IEC 60601-1:2005 3rd ED PEMS - Medical Electrical
Equipment * End-to-end verification, validation, and testing (VV&T) * FDA
and CE submissions * Open source free testing tools implementation *
Functionality and regression testing * Software Performance & Load testing *
Software Testing Advanced Automation * Medical Software Verification &
Validation * Medical Device Verification & Validation * Medical Device
Regulatory Submission * Organizational Regulatory Qualification

Formerly QA Manager of LoadRunner at Mercury Interactive

M.Sc. cum laude in Bio-Medical Engineering

M.Sc. in Mechanical Engineering


Work:   +972(0)3-5185873

Mobile:  +972(0)54-6690915


Email: sginsbourg@gmail.com


Visit my personal page on LinkedIn at:
http://www.linkedin.com/in/shayginsbourg


Please consider your environmental responsibility before printing this
e-mail.

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


Re: Regular Expression Extractor Returns Spaces instead of characters

Posted by Flavio Cysne <fl...@gmail.com>.
Although it's solved, I suggest you to change the RegEx to this:
content="([^"]+)" name="csrf-token"
It's simpler and, this way, you will not bother about what is inside the
quotation marks.
If the content attribute's value should contain quotation marks (what I
suppose will be escaped), you could use this: content="([^"[\\"]]*)"
name="csrf-token"


2013/3/26 Aaron Tracy <Aa...@octanner.com>

> Thanks Sebb!  That fixed it! ;)
>
> -----Original Message-----
> From: sebb [mailto:sebbaz@gmail.com]
> Sent: Tuesday, March 26, 2013 4:41 PM
> To: JMeter Users List
> Subject: Re: Regular Expression Extractor Returns Spaces instead of
> characters
>
> On 26 March 2013 22:19, Aaron Tracy <Aa...@octanner.com> wrote:
> > Hi!
> >
> >   I've got a regular expression (
> content=\"([A-Za-z0-9!"#$%&'()*+,./:;<=>?@\^_`{|}~-]+)\" name="csrf-token )
> That grabs my authentication token, the problem that I'm having is that
> when I use the variable that should have my authentication token that looks
> like this:
> >
> > ELVM+rEgERKSGA4d9mld+PiMf1dRtub9wuuBE1rKflM=
> >
> > Is stored in the variable and used in another request, the + and = are
> stripped from the token and
>
> Check the contents of the variable using a Debug Sampler.
>
> How/where is the variable being used?
>
> > ELVM rEgERKSGA4d9mld PiMf1dRtub9wuuBE1rKflM
> >
> > Is used instead which causes my script to break.  I've tried to wrap a
> function around it to replace all spaces with a + but that didn't work (
> not to mention this doesn't handle the missing = ).  How do I escape the +
> and = characters so the variable retains the + and = signs?
> >
> > Thank you!
> >
>
> ---------------------------------------------------------------------
> 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: Regular Expression Extractor Returns Spaces instead of characters

Posted by Aaron Tracy <Aa...@octanner.com>.
Thanks Sebb!  That fixed it! ;)

-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com] 
Sent: Tuesday, March 26, 2013 4:41 PM
To: JMeter Users List
Subject: Re: Regular Expression Extractor Returns Spaces instead of characters

On 26 March 2013 22:19, Aaron Tracy <Aa...@octanner.com> wrote:
> Hi!
>
>   I've got a regular expression ( content=\"([A-Za-z0-9!"#$%&'()*+,./:;<=>?@\^_`{|}~-]+)\" name="csrf-token ) That grabs my authentication token, the problem that I'm having is that when I use the variable that should have my authentication token that looks like this:
>
> ELVM+rEgERKSGA4d9mld+PiMf1dRtub9wuuBE1rKflM=
>
> Is stored in the variable and used in another request, the + and = are stripped from the token and

Check the contents of the variable using a Debug Sampler.

How/where is the variable being used?

> ELVM rEgERKSGA4d9mld PiMf1dRtub9wuuBE1rKflM
>
> Is used instead which causes my script to break.  I've tried to wrap a function around it to replace all spaces with a + but that didn't work ( not to mention this doesn't handle the missing = ).  How do I escape the + and = characters so the variable retains the + and = signs?
>
> Thank you!
>

---------------------------------------------------------------------
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: Regular Expression Extractor Returns Spaces instead of characters

Posted by Aaron Tracy <Aa...@octanner.com>.
The debug postprocessor displays the correct information

authenticity_token=eEUvCjd8Qw9HtaAsVyXjQVGiWHwPUT9uhtwZw+xusK8=
authenticity_token_g=1
authenticity_token_g0=content="eEUvCjd8Qw9HtaAsVyXjQVGiWHwPUT9uhtwZw+xusK8=" name="csrf-token
authenticity_token_g1=eEUvCjd8Qw9HtaAsVyXjQVGiWHwPUT9uhtwZw+xusK8=


But when I view it in the next http request where it's used as a value for one of my parameters, it is eEUvCjd8Qw9HtaAsVyXjQVGiWHwPUT9uhtwZw xusK8

-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com] 
Sent: Tuesday, March 26, 2013 4:41 PM
To: JMeter Users List
Subject: Re: Regular Expression Extractor Returns Spaces instead of characters

On 26 March 2013 22:19, Aaron Tracy <Aa...@octanner.com> wrote:
> Hi!
>
>   I've got a regular expression ( content=\"([A-Za-z0-9!"#$%&'()*+,./:;<=>?@\^_`{|}~-]+)\" name="csrf-token ) That grabs my authentication token, the problem that I'm having is that when I use the variable that should have my authentication token that looks like this:
>
> ELVM+rEgERKSGA4d9mld+PiMf1dRtub9wuuBE1rKflM=
>
> Is stored in the variable and used in another request, the + and = are stripped from the token and

Check the contents of the variable using a Debug Sampler.

How/where is the variable being used?

> ELVM rEgERKSGA4d9mld PiMf1dRtub9wuuBE1rKflM
>
> Is used instead which causes my script to break.  I've tried to wrap a function around it to replace all spaces with a + but that didn't work ( not to mention this doesn't handle the missing = ).  How do I escape the + and = characters so the variable retains the + and = signs?
>
> Thank you!
>

---------------------------------------------------------------------
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: Regular Expression Extractor Returns Spaces instead of characters

Posted by sebb <se...@gmail.com>.
On 26 March 2013 22:19, Aaron Tracy <Aa...@octanner.com> wrote:
> Hi!
>
>   I've got a regular expression ( content=\"([A-Za-z0-9!"#$%&'()*+,./:;<=>?@\^_`{|}~-]+)\" name="csrf-token ) That grabs my authentication token, the problem that I'm having is that when I use the variable that should have my authentication token that looks like this:
>
> ELVM+rEgERKSGA4d9mld+PiMf1dRtub9wuuBE1rKflM=
>
> Is stored in the variable and used in another request, the + and = are stripped from the token and

Check the contents of the variable using a Debug Sampler.

How/where is the variable being used?

> ELVM rEgERKSGA4d9mld PiMf1dRtub9wuuBE1rKflM
>
> Is used instead which causes my script to break.  I've tried to wrap a function around it to replace all spaces with a + but that didn't work ( not to mention this doesn't handle the missing = ).  How do I escape the + and = characters so the variable retains the + and = signs?
>
> Thank you!
>

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


Re: Regular Expression Extractor Returns Spaces instead of characters

Posted by Deepak Shetty <sh...@gmail.com>.
Try with true.


On Tue, Mar 26, 2013 at 3:56 PM, Aaron Tracy <Aa...@octanner.com>wrote:

> Encode = false
>
> -----Original Message-----
> From: Deepak Shetty [mailto:shettyd@gmail.com]
> Sent: Tuesday, March 26, 2013 4:55 PM
> To: JMeter Users List
> Subject: Re: Regular Expression Extractor Returns Spaces instead of
> characters
>
> what is the value of the encode checkbox?
>
>
> On Tue, Mar 26, 2013 at 3:19 PM, Aaron Tracy <Aaron.Tracy@octanner.com
> >wrote:
>
> > Hi!
> >
> >   I've got a regular expression (
> > content=\"([A-Za-z0-9!"#$%&'()*+,./:;<=>?@\^_`{|}~-]+)\"
> > name="csrf-token ) That grabs my authentication token, the problem
> > that I'm having is that when I use the variable that should have my
> > authentication token that looks like this:
> >
> > ELVM+rEgERKSGA4d9mld+PiMf1dRtub9wuuBE1rKflM=
> >
> > Is stored in the variable and used in another request, the + and = are
> > stripped from the token and
> >
> > ELVM rEgERKSGA4d9mld PiMf1dRtub9wuuBE1rKflM
> >
> > Is used instead which causes my script to break.  I've tried to wrap a
> > function around it to replace all spaces with a + but that didn't work
> > ( not to mention this doesn't handle the missing = ).  How do I escape
> > the + and = characters so the variable retains the + and = signs?
> >
> > Thank you!
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

RE: Regular Expression Extractor Returns Spaces instead of characters

Posted by Aaron Tracy <Aa...@octanner.com>.
Encode = false

-----Original Message-----
From: Deepak Shetty [mailto:shettyd@gmail.com] 
Sent: Tuesday, March 26, 2013 4:55 PM
To: JMeter Users List
Subject: Re: Regular Expression Extractor Returns Spaces instead of characters

what is the value of the encode checkbox?


On Tue, Mar 26, 2013 at 3:19 PM, Aaron Tracy <Aa...@octanner.com>wrote:

> Hi!
>
>   I've got a regular expression (
> content=\"([A-Za-z0-9!"#$%&'()*+,./:;<=>?@\^_`{|}~-]+)\" 
> name="csrf-token ) That grabs my authentication token, the problem 
> that I'm having is that when I use the variable that should have my 
> authentication token that looks like this:
>
> ELVM+rEgERKSGA4d9mld+PiMf1dRtub9wuuBE1rKflM=
>
> Is stored in the variable and used in another request, the + and = are 
> stripped from the token and
>
> ELVM rEgERKSGA4d9mld PiMf1dRtub9wuuBE1rKflM
>
> Is used instead which causes my script to break.  I've tried to wrap a 
> function around it to replace all spaces with a + but that didn't work 
> ( not to mention this doesn't handle the missing = ).  How do I escape 
> the + and = characters so the variable retains the + and = signs?
>
> Thank you!
>
>

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


Re: Regular Expression Extractor Returns Spaces instead of characters

Posted by Deepak Shetty <sh...@gmail.com>.
what is the value of the encode checkbox?


On Tue, Mar 26, 2013 at 3:19 PM, Aaron Tracy <Aa...@octanner.com>wrote:

> Hi!
>
>   I've got a regular expression (
> content=\"([A-Za-z0-9!"#$%&'()*+,./:;<=>?@\^_`{|}~-]+)\" name="csrf-token )
> That grabs my authentication token, the problem that I'm having is that
> when I use the variable that should have my authentication token that looks
> like this:
>
> ELVM+rEgERKSGA4d9mld+PiMf1dRtub9wuuBE1rKflM=
>
> Is stored in the variable and used in another request, the + and = are
> stripped from the token and
>
> ELVM rEgERKSGA4d9mld PiMf1dRtub9wuuBE1rKflM
>
> Is used instead which causes my script to break.  I've tried to wrap a
> function around it to replace all spaces with a + but that didn't work (
> not to mention this doesn't handle the missing = ).  How do I escape the +
> and = characters so the variable retains the + and = signs?
>
> Thank you!
>
>