jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ChristopherPesarch...@westfieldgrp.com
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)
toString(),myString)}

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
word?

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.

Thanks,
Chris



                                                                                         
                                                       
                      ChristopherPesarchick@westf                                        
                                                       
                      ieldgrp.com                        To:       "JMeter Users List" <jmeter-user@jakarta.apache.org>
                         
                                                         cc:                             
                                                       
                      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.

Thanks,
Chris





                      mstover1@apache.o
                      rg                       To:       JMeter Users List
                      <jmeter-user@jakarta.apache.org>
                                               cc:
                      10/13/2003 12:24         Subject:  RE: String
                      replacement
                      PM
                      Please respond to
                      "JMeter Users
                      List"






I get the impression what he'd like is for the value from StringFromFile to
be
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
you
could probably do something like:

${__specialFunction()}${__StringFromFile(partial_values.txt)}

Where, instead of putting the special function in the data file, put it in
the
JMeter component and just put the remaining static part of your value int
the
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
would
incur a potentially severe performance hit.  Right now all functions are
"compiled" before the test starts, which helps performance greatly.

-Mike

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
to
> 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
different
> files.
>
> S.
> -----Original Message-----
> From: ChristopherPesarchick@westfieldgrp.com
> [mailto:ChristopherPesarchick@westfieldgrp.com]
> 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
some
> other value?
> Similar functionality as a replaceFirst in the java String object.
>
> Thanks,
> Chris
>
>
> ---------------------------------------------------------------------
> 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
>




--
Michael Stover
mstover1@apache.org
Yahoo IM: mstover_ya
ICQ: 152975688
AIM: mstover777

---------------------------------------------------------------------
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




---------------------------------------------------------------------
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