jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepak Shetty <shet...@gmail.com>
Subject Re: Jmeter replace
Date Wed, 07 Apr 2010 20:03:07 GMT
Hi
You should probably use
str = vars.get("MyVar");
str=str.replaceAll("<timestamp>111</timestamp>",
"<timestamp>222<timestamp>");

regards
deepak



On Wed, Apr 7, 2010 at 1:01 PM, Deepak Shetty <shettyd@gmail.com> wrote:

> if your code is literal then you havent closed the quote
> str = "${MyVar}
>
> Check if there are beanshell errors. if not check that you dont have any
> whitespace in the xml(or change the replace all to be a regexp that will
> match)
>
> regards
> deepak
>
>
>
> On Wed, Apr 7, 2010 at 12:49 PM, <sv@icarinae.com> wrote:
>
>> Hi,
>>
>> I have a xml request, that I have saved in a variable. There is timestamp
>> parameter that I need to update with system time.
>>
>> I understand that i can get time using time function, however I have to
>> replace the value in the xml.
>>
>> for example <timestamp>111</timestamp> to be replaced with
>> <timestamp>222<timestamp>
>>
>> Is there any way I can replace that value in the xml that is saved
>> ${MyVar}.
>>
>> I tried using  str = "${MyVar};
>> str=str.replaceAll("<timestamp>111</timestamp>",
>> "<timestamp>222<timestamp>");
>> in beanshell sampler, but it looks like " need to escaped etc..
>>
>> Any other solution?
>>
>> Thanks in advance..
>>
>> Deepak Tiwari
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>
>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message