jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject RE: String replacement
Date Mon, 13 Oct 2003 16:53:02 GMT

I got a little closer.  Starting to understand javaScript a little.
${__javaScript( var S = new String("See Jane Run") ; with (S)

2 problems.
1.  How do I pass "See Jane Run" as a variable?
2.  Where I have toString(), what can I do to replace Jane with another

I am learning java script as I go, hence the toString().  Just doing it one
step at a time.

I hope I am starting to make my problem understandable.


                                    To:       "JMeter Users List" <>
                      10/13/2003 12:36 PM                Subject:  RE: String replacement
                      Please respond to "JMeter                                          
                      Users List"                                                        

I don't think I made myself clear.

StringFromFile reads in a file.  Lets say that it says "See jane run.".
Once I read that in, I want to change "jane" to some other word for each
loop and thread.

Very simplistic example, but that is the functionality I need.
I hope that makes more sense.


                      rg                       To:       JMeter Users List
                      10/13/2003 12:24         Subject:  RE: String
                      Please respond to
                      "JMeter Users

I get the impression what he'd like is for the value from StringFromFile to
interpreted as a possible JMeter function, but that doesn't happen right
now -
the function returns it's string without looking at it.

It seems a little odd that you'd need to have a list of values each with
_different_ functions within them.  If the same function would serve, then
could probably do something like:


Where, instead of putting the special function in the data file, put it in
JMeter component and just put the remaining static part of your value int
data file.

If you really intend to use different functions for each value, then I
don't see a
way of doing that, right now.  I suppose JMeter could be modified to always
check functions' return values as possible functions themselves, but that
incur a potentially severe performance hit.  Right now all functions are
"compiled" before the test starts, which helps performance greatly.


On 13 Oct 2003 at 17:02, BAZLEY, Sebastian wrote:

> Try the regex or javascript functions.
> Or perhaps you could edit the input file? - you can have multiple calls
> SFF in the test plan, and each has its own reader, so if you want several
> pieces of information at once, you could instead read from several
> files.
> S.
> -----Original Message-----
> From:
> []
> Sent: 13 October 2003 16:56
> To: JMeter Users List
> Subject: String replacement
> I load in a string using StringFromFile function.
> Once I get the string, how can I replace a portion of the string with
> other value?
> Similar functionality as a replaceFirst in the java String object.
> Thanks,
> Chris
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Michael Stover
Yahoo IM: mstover_ya
ICQ: 152975688
AIM: mstover777

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message