You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by "Willoughby, Kevin" <Ke...@arrisi.com> on 2008/11/17 17:50:15 UTC

Parameterizing a URL

I'm having trouble parameterizing a URL in Jmeter (v 2.3.2).

I have a logfile of URLs, read with a CSV Data Set, and a second file of parameter values read with a second CSV Data Set. I want to replace a parameter ("mac_address") in the URL with the value from the second file. I.e., I want to convert http://localhost/info?macAddress=00%3A19%3Aa6%3A10%3A89%3Ade& to /info?macAddress=${mac_address}&

I'm using an HTTP Request path of
${__regexFunction(.*//[^/]*(.*)acAddress=[0-9a-fA-F%]*(.*),$1$acAddress=${mac_address}$2$,1,,${url},mac_url,url)}
to both remove the "http://localhost" from the url and to replace the mac-address parameter. Alas, I'm getting the mac_address at the end of the url, not in the middle.

A Debug Sampler shows:
url=http://localhost/SM_WS/rest/customer/info?accountNumber=12340019A61089DE&macAddress=00%3A19%3Aa6%3A10%3A89%3Ad e&name=spam
mac_url=/SM_WS/rest/customer/info?accountNumber=12340019A61089DE&m&name=spamacAddress=00%3A00%3A39%3Abc%3A16%3A5e
mac_url_g0=http://localhost/SM_WS/rest/customer/info?accountNumber=12340019A61089DE&macAddress=00%3A19%3Aa6%3A10%3A89%3Ade&name=spam
mac_url_g1=/SM_WS/rest/customer/info?accountNumber=12340019A61089DE&m
mac_url_g2=&name=spam
mac_url_matchNr=1

Am I doing something wrong, or is this a bug in JMeter?



Re: Parameterizing a URL

Posted by sebb <se...@gmail.com>.
FYI: I've found the problem and fixed it for the next version.

[The Regex Extractor Post-Processor has to do much the same
processing, and that works OK - comparison of the two provided a
simple fix]

On 18/11/2008, sebb <se...@gmail.com> wrote:
> OK, thanks for reporting the problem.
>
>
>  On 18/11/2008, Willoughby, Kevin <Ke...@arrisi.com> wrote:
>  > The workaround works just fine.
>  >  Thank you!
>  >
>  >
>  >  > -----Original Message-----
>  >  > From: sebb [mailto:sebbaz@gmail.com]
>  >  > Sent: Tuesday, November 18, 2008 8:20 AM
>  >  > To: JMeter Users List
>  >  > Subject: Re: Parameterizing a URL
>  >  >
>  >  > So a work-round is to add some leading text to the template - even a
>  >  > space will do.
>  >
>  >
>  > ---------------------------------------------------------------------
>  >  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  >  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>  >
>  >
>

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


Testing ISO 8583/APACS 60 with JMeter

Posted by Hiro Protagonist <hi...@googlemail.com>.
Hi all,

I was wondering if someone has successfully used JMeter to test against
the ISO 8583 protocol. I am currently evaluating how to performance test
this, and would like to know if someone can point me to
FAQs/HOWTOs/articles about this - or perhaps share your experience on
how you tested it.
My first step would be to find a suitable open-source implementation for
this (looking at jpos and niso8583) to help me get familiar with the
messaging system (since I have not had any exposure to this
protocol/system, I will rely heavily on the debbuging output from the
server...) and then use JMeter to send messages to the server.

Thanks for any input you can provide on this !

Regards,
hiro


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


Re: Parameterizing a URL

Posted by sebb <se...@gmail.com>.
OK, thanks for reporting the problem.

On 18/11/2008, Willoughby, Kevin <Ke...@arrisi.com> wrote:
> The workaround works just fine.
>  Thank you!
>
>
>  > -----Original Message-----
>  > From: sebb [mailto:sebbaz@gmail.com]
>  > Sent: Tuesday, November 18, 2008 8:20 AM
>  > To: JMeter Users List
>  > Subject: Re: Parameterizing a URL
>  >
>  > So a work-round is to add some leading text to the template - even a
>  > space will do.
>
>
> ---------------------------------------------------------------------
>  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

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


RE: Parameterizing a URL

Posted by "Willoughby, Kevin" <Ke...@arrisi.com>.
The workaround works just fine.
Thank you!

> -----Original Message-----
> From: sebb [mailto:sebbaz@gmail.com]
> Sent: Tuesday, November 18, 2008 8:20 AM
> To: JMeter Users List
> Subject: Re: Parameterizing a URL
>
> So a work-round is to add some leading text to the template - even a
> space will do.

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


Re: Parameterizing a URL

Posted by sebb <se...@gmail.com>.
On 17/11/2008, Willoughby, Kevin <Ke...@arrisi.com> wrote:
> I'm having trouble parameterizing a URL in Jmeter (v 2.3.2).
>
>  I have a logfile of URLs, read with a CSV Data Set, and a second file of parameter values read with a second CSV Data Set. I want to replace a parameter ("mac_address") in the URL with the value from the second file. I.e., I want to convert http://localhost/info?macAddress=00%3A19%3Aa6%3A10%3A89%3Ade& to /info?macAddress=${mac_address}&

That does not agree with your example below, where the macAddress appears later.

>  I'm using an HTTP Request path of
>  ${__regexFunction(.*//[^/]*(.*)acAddress=[0-9a-fA-F%]*(.*),$1$acAddress=${mac_address}$2$,1,,${url},mac_url,url)}

This is composed of:

Regex:   .*//[^/]*(.*)acAddress=[0-9a-fA-F%]*(.*)
Template: $1$acAddress=${mac_address}$2$
Match number: 1
ALL separator:
Default:       ${url}
Reference Name: mac_url
Input variable: url

>  to both remove the "http://localhost" from the url and to replace the mac-address parameter. Alas, I'm getting the mac_address at the end of the url, not in the middle.
>
>  A Debug Sampler shows:
>  url=http://localhost/SM_WS/rest/customer/info?accountNumber=12340019A61089DE&macAddress=00%3A19%3Aa6%3A10%3A89%3Ad e&name=spam

OK.

>  mac_url=/SM_WS/rest/customer/info?accountNumber=12340019A61089DE&m&name=spamacAddress=00%3A00%3A39%3Abc%3A16%3A5e

This is a bit odd.

>  mac_url_g0=http://localhost/SM_WS/rest/customer/info?accountNumber=12340019A61089DE&macAddress=00%3A19%3Aa6%3A10%3A89%3Ade&name=spam

OK, the whole URL is matched by the pattern.

>  mac_url_g1=/SM_WS/rest/customer/info?accountNumber=12340019A61089DE&m

OK, this is the bit before the macAddress.

>  mac_url_g2=&name=spam

OK, this is the bit after the macAddress

>  mac_url_matchNr=1
>
>  Am I doing something wrong, or is this a bug in JMeter?

It's a bug in JMeter.

Not sure why yet, but if the template looks like:

$1$xxx$2$

then it is handled as

$1$$2$xxx

whereas

aaa$1$xxx$2$

works OK.

So a work-round is to add some leading text to the template - even a
space will do.

e.g. in your case you could use "/", just change the RE to:

Regex:   .*//[^/]*/(.*)acAddress=[0-9a-fA-F%]*(.*)

By the way, the leading .* could be dropped.


>
>

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