You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Ryszard Lach <si...@autograf.pl> on 2005/11/02 12:41:23 UTC
HTTP Proxy Server and Regex Matching
Hi.
According to documentation when http proxy server finds in response a
string which matches value of UDV it is replaced in testing profile by a
name of this variable, right?
I think, that more useful would be if one could define a variable, which
would substitute a string with a pair like 'string=${variable}', e.g.
like that:
if you find string matching id_user=(\w+), then replace it with
id_user=${username}
Is something like that possible?
R.
--
"First they ignore you. Then they laugh at you. Then they
fight you. Then you win." - Mohandas Gandhi.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
Re: HTTP Proxy Server and Regex Matching
Posted by sebb <se...@gmail.com>.
On 02/11/05, Ryszard Łach <si...@autograf.pl> wrote:
> Dnia środa, 2 listopada 2005 14:09, sebb napisał:
> > Sounds like a useful enhancement - but I'm not clear how would you
> > tell JMeter how to find the text.
> >
> > Do you have any suggestions for the changes to the UI?
> >
>
> Maybe another configuration element or part of http proxy server, similar to
> User Defined Variables with columns:
>
> "pattern" -> "referencing variable"
>
> e.g.
>
> id_user=(\d+) -> id
>
> resulting in replacement
>
> id_user=${id}
>
> I was trying to use UDV for that entering regexp as value. Maybe a checkbox
> telling "use value as pattern" would be enough? When checked it could cause
> replacing match with variable's name; this of course would require defining
> the variable once more with this checkbox unchecked (to replace the variable
> with value during test plan execution).
I don't see how this can be done with the existing variable definition
test elements.
How about adding a "Replacement Pattern" section to the Proxy server?
For example:
Match RE Replacement
id_user=\d+ id_user=${id}
pair=\(\d+,\d+) pair=(${a},${b})
The Match string would be assumed to be a Regular Expression.
Would this meet your needs?
S.
Re: HTTP Proxy Server and Regex Matching
Posted by Ryszard Łach <si...@autograf.pl>.
Dnia środa, 2 listopada 2005 14:09, sebb napisał:
> Sounds like a useful enhancement - but I'm not clear how would you
> tell JMeter how to find the text.
>
> Do you have any suggestions for the changes to the UI?
>
Maybe another configuration element or part of http proxy server, similar to
User Defined Variables with columns:
"pattern" -> "referencing variable"
e.g.
id_user=(\d+) -> id
resulting in replacement
id_user=${id}
I was trying to use UDV for that entering regexp as value. Maybe a checkbox
telling "use value as pattern" would be enough? When checked it could cause
replacing match with variable's name; this of course would require defining
the variable once more with this checkbox unchecked (to replace the variable
with value during test plan execution).
Richard.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
Re: HTTP Proxy Server and Regex Matching
Posted by sebb <se...@gmail.com>.
Sounds like a useful enhancement - but I'm not clear how would you
tell JMeter how to find the text.
Do you have any suggestions for the changes to the UI?
S.
On 02/11/05, Ryszard Lach <si...@autograf.pl> wrote:
> Hi.
> According to documentation when http proxy server finds in response a
> string which matches value of UDV it is replaced in testing profile by a
> name of this variable, right?
>
> I think, that more useful would be if one could define a variable, which
> would substitute a string with a pair like 'string=${variable}', e.g.
> like that:
>
> if you find string matching id_user=(\w+), then replace it with
> id_user=${username}
>
> Is something like that possible?
>
> R.
>
> --
> "First they ignore you. Then they laugh at you. Then they
> fight you. Then you win." - Mohandas Gandhi.
>
> ---------------------------------------------------------------------
> 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