jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Avishek Daga <avishekd...@gmail.com>
Subject Re: search & replace
Date Tue, 31 Jul 2007 09:19:43 GMT

In a  bean shell script a jmeter variable is accessed as
vars.get("jmeter_variable_name")

Hence, your code should be 
print(vars.get("url"));
prout = vars.get("url");
.
.
.


75blured wrote:
> 
> Hi,
> 
> I've finally opted for a bean shell post processor:
> import java.util.regex.*;
> 
> ------------------< cut here >------------------------------------
> print("${url}");
> 
> prout = ${url};
> patternStr = "&amp;";
> replacementStr = "&";
> 
> // Compile regular expression
> pattern = Pattern.compile(patternStr);
> 
> // Replace all occurrences of pattern in input
> matcher = pattern.matcher(prout);
> output = matcher.replaceAll(replacementStr);
> print("output : " + output);
> ------------------< cut here >------------------------------------
> 
> However it seems to not find ${url} when  assigning it to prout variable
> ...
> 
> Do you know a way to do it ?
> 
> Regards,
> 75Blured.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/search---replace-tf4170716.html#a11920761
Sent from the JMeter - User mailing list archive at Nabble.com.


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


Mime
View raw message