You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Mark Musone <mm...@gmail.com> on 2009/03/17 15:28:15 UTC

Using UDV in SOAP Request

Hi All,

I'm trying to use a User Defined Variable (I have it set to a static value
for now) using the WebService (SOAP) Request.
when I paste the XML in the SOAP/XML-RPC Data box, it works perfectly
fine..the variable gets substituted and sent.

I however would like to load the XML file using the "File with SOAP XML
Data" field..essentially just give it the filename.
When I put the same exact XML in a plain text file and specify the file, the
variable does NOT get substituted, and instead, the SOAP request gets sent
along as-is
(i.e. the ${variable} is sent literally)

The same goes for using the "Message Folder" option, which, long term, is
really what i'd like to use.

So is there something i'm missing on how to get UDV's working when
referencing an XML SOAP file?

Thanks for any help,

Mark

Re: Using UDV in SOAP Request

Posted by Mark Musone <mm...@gmail.com>.
Excellent. Thanks for the help. I appreciate the info.

Mark


On Tue, Mar 17, 2009 at 11:00 AM, sebb <se...@gmail.com> wrote:

> On 17/03/2009, Mark Musone <mm...@gmail.com> wrote:
> > Thanks a ton for your insight.
> >
> >  I'm planning on using a random number or reading it from a CSV. The SOAP
> >  request needs a unique RequestID field that has to be different than any
> >  other RequestID that has ever been sent..
> >
> >  I figured i'd define the UDV (not in the test plan level, in the SOAP
> >  request level) and it'll send a unique one for each thread and thread
> >  iteration..does that make sense?
>
> No, UDVs are not suitable.
>
> Try User Parameters Pre-Processor or CSV Dataset.
>
> >  If this is incorrect, and each thread shares that same initial UDV, i
> figure
> >  i can just reference the random() function directly in the XML..unless
> you
> >  have a better suggestion. Does jmeter process a function call in an
> external
> >  file?
> >
>
> No, JMeter does not process anything in external files, neither
> variables nor functions.
>
> This has been discussed in the past, please check the archives.
>
> >  Thanks again,
> >
> > Mark
> >
> >
> >
> >  On Tue, Mar 17, 2009 at 10:44 AM, sebb <se...@gmail.com> wrote:
> >
> >  > On 17/03/2009, Mark Musone <mm...@gmail.com> wrote:
> >  > > Hi All,
> >  > >
> >  > >  I'm trying to use a User Defined Variable (I have it set to a
> static
> >  > value
> >  > >  for now) using the WebService (SOAP) Request.
> >  > >  when I paste the XML in the SOAP/XML-RPC Data box, it works
> perfectly
> >  > >  fine..the variable gets substituted and sent.
> >  > >
> >  > >  I however would like to load the XML file using the "File with SOAP
> XML
> >  > >  Data" field..essentially just give it the filename.
> >  > >  When I put the same exact XML in a plain text file and specify the
> file,
> >  > the
> >  > >  variable does NOT get substituted, and instead, the SOAP request
> gets
> >  > sent
> >  > >  along as-is
> >  > >  (i.e. the ${variable} is sent literally)
> >  > >
> >  > >  The same goes for using the "Message Folder" option, which, long
> term,
> >  > is
> >  > >  really what i'd like to use.
> >  > >
> >  > >  So is there something i'm missing on how to get UDV's working when
> >  > >  referencing an XML SOAP file?
> >  >
> >  > Variables are not substituted in files, only in fields defined in the
> GUI.
> >  >
> >  > Also, UDVs are evaluated at startup, so are only suitable for items
> >  > that vary between test runs, not for items that vary during a run.
> >  >
> >  > >  Thanks for any help,
> >  > >
> >  > >
> >  > >  Mark
> >  > >
> >  >
> >
> > > ---------------------------------------------------------------------
> >  > 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
>
>

Re: Using UDV in SOAP Request

Posted by sebb <se...@gmail.com>.
On 17/03/2009, Mark Musone <mm...@gmail.com> wrote:
> Thanks a ton for your insight.
>
>  I'm planning on using a random number or reading it from a CSV. The SOAP
>  request needs a unique RequestID field that has to be different than any
>  other RequestID that has ever been sent..
>
>  I figured i'd define the UDV (not in the test plan level, in the SOAP
>  request level) and it'll send a unique one for each thread and thread
>  iteration..does that make sense?

No, UDVs are not suitable.

Try User Parameters Pre-Processor or CSV Dataset.

>  If this is incorrect, and each thread shares that same initial UDV, i figure
>  i can just reference the random() function directly in the XML..unless you
>  have a better suggestion. Does jmeter process a function call in an external
>  file?
>

No, JMeter does not process anything in external files, neither
variables nor functions.

This has been discussed in the past, please check the archives.

>  Thanks again,
>
> Mark
>
>
>
>  On Tue, Mar 17, 2009 at 10:44 AM, sebb <se...@gmail.com> wrote:
>
>  > On 17/03/2009, Mark Musone <mm...@gmail.com> wrote:
>  > > Hi All,
>  > >
>  > >  I'm trying to use a User Defined Variable (I have it set to a static
>  > value
>  > >  for now) using the WebService (SOAP) Request.
>  > >  when I paste the XML in the SOAP/XML-RPC Data box, it works perfectly
>  > >  fine..the variable gets substituted and sent.
>  > >
>  > >  I however would like to load the XML file using the "File with SOAP XML
>  > >  Data" field..essentially just give it the filename.
>  > >  When I put the same exact XML in a plain text file and specify the file,
>  > the
>  > >  variable does NOT get substituted, and instead, the SOAP request gets
>  > sent
>  > >  along as-is
>  > >  (i.e. the ${variable} is sent literally)
>  > >
>  > >  The same goes for using the "Message Folder" option, which, long term,
>  > is
>  > >  really what i'd like to use.
>  > >
>  > >  So is there something i'm missing on how to get UDV's working when
>  > >  referencing an XML SOAP file?
>  >
>  > Variables are not substituted in files, only in fields defined in the GUI.
>  >
>  > Also, UDVs are evaluated at startup, so are only suitable for items
>  > that vary between test runs, not for items that vary during a run.
>  >
>  > >  Thanks for any help,
>  > >
>  > >
>  > >  Mark
>  > >
>  >
>
> > ---------------------------------------------------------------------
>  > 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


Re: Using UDV in SOAP Request

Posted by Mark Musone <mm...@gmail.com>.
Thanks a ton for your insight.

I'm planning on using a random number or reading it from a CSV. The SOAP
request needs a unique RequestID field that has to be different than any
other RequestID that has ever been sent..

I figured i'd define the UDV (not in the test plan level, in the SOAP
request level) and it'll send a unique one for each thread and thread
iteration..does that make sense?

If this is incorrect, and each thread shares that same initial UDV, i figure
i can just reference the random() function directly in the XML..unless you
have a better suggestion. Does jmeter process a function call in an external
file?


Thanks again,
Mark


On Tue, Mar 17, 2009 at 10:44 AM, sebb <se...@gmail.com> wrote:

> On 17/03/2009, Mark Musone <mm...@gmail.com> wrote:
> > Hi All,
> >
> >  I'm trying to use a User Defined Variable (I have it set to a static
> value
> >  for now) using the WebService (SOAP) Request.
> >  when I paste the XML in the SOAP/XML-RPC Data box, it works perfectly
> >  fine..the variable gets substituted and sent.
> >
> >  I however would like to load the XML file using the "File with SOAP XML
> >  Data" field..essentially just give it the filename.
> >  When I put the same exact XML in a plain text file and specify the file,
> the
> >  variable does NOT get substituted, and instead, the SOAP request gets
> sent
> >  along as-is
> >  (i.e. the ${variable} is sent literally)
> >
> >  The same goes for using the "Message Folder" option, which, long term,
> is
> >  really what i'd like to use.
> >
> >  So is there something i'm missing on how to get UDV's working when
> >  referencing an XML SOAP file?
>
> Variables are not substituted in files, only in fields defined in the GUI.
>
> Also, UDVs are evaluated at startup, so are only suitable for items
> that vary between test runs, not for items that vary during a run.
>
> >  Thanks for any help,
> >
> >
> >  Mark
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Re: Using UDV in SOAP Request

Posted by sebb <se...@gmail.com>.
On 17/03/2009, Mark Musone <mm...@gmail.com> wrote:
> Hi All,
>
>  I'm trying to use a User Defined Variable (I have it set to a static value
>  for now) using the WebService (SOAP) Request.
>  when I paste the XML in the SOAP/XML-RPC Data box, it works perfectly
>  fine..the variable gets substituted and sent.
>
>  I however would like to load the XML file using the "File with SOAP XML
>  Data" field..essentially just give it the filename.
>  When I put the same exact XML in a plain text file and specify the file, the
>  variable does NOT get substituted, and instead, the SOAP request gets sent
>  along as-is
>  (i.e. the ${variable} is sent literally)
>
>  The same goes for using the "Message Folder" option, which, long term, is
>  really what i'd like to use.
>
>  So is there something i'm missing on how to get UDV's working when
>  referencing an XML SOAP file?

Variables are not substituted in files, only in fields defined in the GUI.

Also, UDVs are evaluated at startup, so are only suitable for items
that vary between test runs, not for items that vary during a run.

>  Thanks for any help,
>
>
>  Mark
>

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


Re: Using UDV in SOAP Request

Posted by Noel O'Brien <no...@newbay.com>.
On Wednesday 18 March 2009 03:31:41 sebb wrote:
> On 18/03/2009, Mark Musone <mm...@gmail.com> wrote:
> > Ok, so here's my dilema..hopefully someone can give me some suggestions
> > on a high level what would make the most sense for JMeter to do:
> >  I've got literally about 1000 different SOAP/XML requests, each one
> > being different enough to warrent being in their own file. For example,
> > I've got a general SOAP request to "Store a Document", Well the document
> > can be very many different types (PDF, word, plain text..etc..), each
> > type has their own properties So i've got 100 or so different "Store a
> > Document" SOAP/XML files, each one storing a different type.
>
> I find it a bit surprising that there are so many different SOAP requests.
> Is there no way to parameterize these and use fewer requests?
>
> In the limit, I suppose one could have a variable for the entire SOAP
> body, and just read that  from a CSV file, but that would be very
> awkard to maintain.
>
> Can you not find more similarities that would allow one to use small
> chunks of text as variables?
>
> >  However, for each document "type", there are properties i need to be
> >  variable (I want a random word document name, or  if it's a JPEG image
> > the height and width should be random..etc..)
> >
> >  My original idea was going to hopefully be simple in such that in each
> > of these 1,000 XML files, i'd just reference a ${variable} whenever I
> > wanted dynamic info..all of these XML files themselves would simply be
> > pointed to by the "Message Folder" attribute, and JMeter'll magically
> > pick any of the 1,000 XML files and magically do the variable
> > substitution.
> >
> >  Now that I understand it's not as cut and dry, with JMeter not
> > processing external files, is there an JMeter-best-practices way to
> > accomplish it?
>
> It's best to reduce the amount of processing that JMeter has to do at
> run-time, so if you can create the personalised files outside JMeter,
> that would be best.
>
> For example, when I first started using JMeter, I needed to generate
> many thousands of randomly orderd unique account ids. That would have
> required a lot of memory to keep track of which ones had been used, so
> I created many smaller batches of accound ids, and used those in turn
> (with the StringFromFile function, which predates CSV Dataset).
>
> >  I believe I can most likely have 1,000 SOAP request samplers (probably
> >  inside a random controller) and copy and paste each of these XML files
> > in each sampler and have the variable substitution work...I guess that's
> > the brute force way..I'm just not sure if there's a better option. I
> > probably just need a pointer from the pro's of "Try this
> > function/config"..
>
> If you are prepared to write some Java, then you could create your own
> copy of the SOAP/XML-RPC sampler to process the files on the fly.
>
> Or you could perhaps use a BeanShell or BSF Pre-Processor to generate
> the contents for the sampler. Or create a BeanShell function that
> returns the SOAP body. Again, coding is needed.

Or, you could store the SOAP requests in files like you're doing, but use 
placeholders where variables are needed. Then use a pre-processor to 
substitute the placeholders for variable data

Regards,
Noel

> >  Thanks,
> >
> > Mark
> >
> >  On Tue, Mar 17, 2009 at 11:04 AM, sebb <se...@gmail.com> wrote:
> >  > On 17/03/2009, Mark Musone <mm...@gmail.com> wrote:
> >  > > Yep, I think you hit the nail on the head..they should rename it to
> >  > > "User Define Constant" or "User Defined Global"!
> >  >
> >  > This has been made clearer in the documentation.
> >  >
> >  > Once the Test Plan and all UDVs have been processed, the resulting set
> >  > of variables is copied to each thread to provide the initial set of
> >  > variables.
> >  >
> >  > I.e. UDVs create regular JMeter variables, but only at test startup.
> >  >
> >  > >  ok, so if i understand it correctly,I basically need to put
> >  > > whatever function call I plan on using directly in the XML Data..
> >  >
> >  > Yes, or pre-create the files and use a variable file name.
> >  >
> >  > >  Will any of the methods you mention below work on external files,
> >  > > or am
> >  >
> >  > i
> >  >
> >  > >  still screwed with being able to dynamically change anything in an
> >  >
> >  > external
> >  >
> >  > >  file?
> >  > >  Thanks,
> >  > >
> >  > >
> >  > >  Mark
> >  > >
> >  > >
> >  > >
> >  > >  On Tue, Mar 17, 2009 at 10:50 AM, Ian Blavins
> >  > > <ib...@temenos.com>
> >  >
> >  > wrote:
> >  > >  > G'day
> >  > >  >
> >  > >  > Despite the name User Defined Variables are in fact (global) user
> >  >
> >  > defined
> >  >
> >  > >  > constants. UDVs are evaluated once prior to the run. Each UDV
> >  > >  > will
> >  >
> >  > take the
> >  >
> >  > >  > final value seen in the test plan and will not change at run
> >  > >  > time.
> >  > >  >
> >  > >  > You can use UDVs to initialize local variables but it is the
> >  > >  > local variables whose values you have to modify during the run to
> >  > >  > achieve
> >  >
> >  > what you
> >  >
> >  > >  > have in mind. (To add to the confusion a local variable can take
> >  > >  > the
> >  >
> >  > same
> >  >
> >  > >  > name as a UDV (which will cause it to be initialized to the
> >  > >  > (static)
> >  >
> >  > value
> >  >
> >  > >  > of the UDV.) This can make it look like the UDV is varying during
> >  > >  > the
> >  >
> >  > run
> >  >
> >  > >  > but it is actually the local variable of the same name whose
> >  > >  > value is changing.)
> >  > >  >
> >  > >  > Modifying the value of a local variable can be done in various
> >  > >  > ways including with user defined parameters, by using the regular
> >  >
> >  > expression
> >  >
> >  > >  > extractor on the results of a sampler, and others.
> >  > >  >
> >  > >  > The manual describes all this pretty accurately but the
> >  > >  > understanding
> >  >
> >  > of
> >  >
> >  > >  > the term 'variable' is so ingrained in IT professionals that many
> >  >
> >  > JMeter
> >  >
> >  > >  > users infer, incorrectly, the operation of UDVs from the name.
> >  > >  >
> >  > >  >
> >  > >  >
> >  > >  > Ian Blavins
> >  > >  > Software performance specialist
> >  > >  > .
> >  > >  > TEMENOS
> >  > >  > The Banking Software Company
> >  > >  > .
> >  > >  > PeopleBuilding 2, Maylands Av
> >  > >  > Hemel Hempstead   UK   HP2 4NW
> >  > >  > .
> >  > >  > T:  +44 (0) 1442 431 106
> >  > >  > E:  iblavins@temenos.com
> >  > >  > .
> >  > >  > www.temenos.com
> >  > >  > .
> >  > >  >
> >  > >  >
> >  > >  > -----Original Message-----
> >  > >  > From: Mark Musone [mailto:mmusone@gmail.com]
> >  > >  > Sent: Tuesday, 17 March 2009 2:28 PM
> >  > >  > To: jmeter-user@jakarta.apache.org
> >  > >  > Subject: Using UDV in SOAP Request
> >  > >  >
> >  > >  > Hi All,
> >  > >  >
> >  > >  > I'm trying to use a User Defined Variable (I have it set to a
> >  > >  > static
> >  >
> >  > value
> >  >
> >  > >  > for now) using the WebService (SOAP) Request.
> >  > >  > when I paste the XML in the SOAP/XML-RPC Data box, it works
> >  > >  > perfectly fine..the variable gets substituted and sent.
> >  > >  >
> >  > >  > I however would like to load the XML file using the "File with
> >  > >  > SOAP
> >  >
> >  > XML
> >  >
> >  > >  > Data" field..essentially just give it the filename.
> >  > >  > When I put the same exact XML in a plain text file and specify
> >  > >  > the
> >  >
> >  > file,
> >  >
> >  > >  > the
> >  > >  > variable does NOT get substituted, and instead, the SOAP request
> >  > >  > gets
> >  >
> >  > sent
> >  >
> >  > >  > along as-is
> >  > >  > (i.e. the ${variable} is sent literally)
> >  > >  >
> >  > >  > The same goes for using the "Message Folder" option, which, long
> >  > >  > term,
> >  >
> >  > is
> >  >
> >  > >  > really what i'd like to use.
> >  > >  >
> >  > >  > So is there something i'm missing on how to get UDV's working
> >  > >  > when referencing an XML SOAP file?
> >  > >  >
> >  > >  > Thanks for any help,
> >  > >  >
> >  > >  > Mark
> >  > >  > Disclaimer:
> >  > >  > If you have received this e-mail in error please notify the
> >  > >  > sender. Please note that any views or opinions presented in this
> >  > >  > e-mail are
> >  >
> >  > solely
> >  >
> >  > >  > those of the author and do not necessarily represent those of
> >  > >  > TEMENOS. We recommend that you check this e-mail and any
> >  > >  > attachments against viruses.
> >  > >  > TEMENOS accepts no liability for any damage caused by any
> >  > >  > malicious
> >  >
> >  > code
> >  >
> >  > >  > or virus transmitted by this e-mail.
> >  > >  >
> >  > >  >
> >  > >  > -----------------------------------------------------------------
> >  > >  >---- 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


Re: Using UDV in SOAP Request

Posted by sebb <se...@gmail.com>.
On 18/03/2009, Mark Musone <mm...@gmail.com> wrote:
> Ok, so here's my dilema..hopefully someone can give me some suggestions on a
>  high level what would make the most sense for JMeter to do:
>  I've got literally about 1000 different SOAP/XML requests, each one being
>  different enough to warrent being in their own file. For example, I've got a
>  general SOAP request to "Store a Document", Well the document can be very
>  many different types (PDF, word, plain text..etc..), each type has their own
>  properties So i've got 100 or so different "Store a Document" SOAP/XML
>  files, each one storing a different type.

I find it a bit surprising that there are so many different SOAP requests.
Is there no way to parameterize these and use fewer requests?

In the limit, I suppose one could have a variable for the entire SOAP
body, and just read that  from a CSV file, but that would be very
awkard to maintain.

Can you not find more similarities that would allow one to use small
chunks of text as variables?

>  However, for each document "type", there are properties i need to be
>  variable (I want a random word document name, or  if it's a JPEG image the
>  height and width should be random..etc..)
>
>  My original idea was going to hopefully be simple in such that in each of
>  these 1,000 XML files, i'd just reference a ${variable} whenever I wanted
>  dynamic info..all of these XML files themselves would simply be pointed to
>  by the "Message Folder" attribute, and JMeter'll magically pick any of the
>  1,000 XML files and magically do the variable substitution.
>
>  Now that I understand it's not as cut and dry, with JMeter not processing
>  external files, is there an JMeter-best-practices way to accomplish it?

It's best to reduce the amount of processing that JMeter has to do at
run-time, so if you can create the personalised files outside JMeter,
that would be best.

For example, when I first started using JMeter, I needed to generate
many thousands of randomly orderd unique account ids. That would have
required a lot of memory to keep track of which ones had been used, so
I created many smaller batches of accound ids, and used those in turn
(with the StringFromFile function, which predates CSV Dataset).

>  I believe I can most likely have 1,000 SOAP request samplers (probably
>  inside a random controller) and copy and paste each of these XML files in
>  each sampler and have the variable substitution work...I guess that's the
>  brute force way..I'm just not sure if there's a better option. I probably
>  just need a pointer from the pro's of "Try this function/config"..

If you are prepared to write some Java, then you could create your own
copy of the SOAP/XML-RPC sampler to process the files on the fly.

Or you could perhaps use a BeanShell or BSF Pre-Processor to generate
the contents for the sampler. Or create a BeanShell function that
returns the SOAP body. Again, coding is needed.

>  Thanks,
>
> Mark
>
>
>
>
>  On Tue, Mar 17, 2009 at 11:04 AM, sebb <se...@gmail.com> wrote:
>
>  > On 17/03/2009, Mark Musone <mm...@gmail.com> wrote:
>  > > Yep, I think you hit the nail on the head..they should rename it to "User
>  > >  Define Constant" or "User Defined Global"!
>  >
>  > This has been made clearer in the documentation.
>  >
>  > Once the Test Plan and all UDVs have been processed, the resulting set
>  > of variables is copied to each thread to provide the initial set of
>  > variables.
>  >
>  > I.e. UDVs create regular JMeter variables, but only at test startup.
>  >
>  > >  ok, so if i understand it correctly,I basically need to put whatever
>  > >  function call I plan on using directly in the XML Data..
>  >
>  > Yes, or pre-create the files and use a variable file name.
>  >
>  > >  Will any of the methods you mention below work on external files, or am
>  > i
>  > >  still screwed with being able to dynamically change anything in an
>  > external
>  > >  file?
>  > >  Thanks,
>  > >
>  > >
>  > >  Mark
>  > >
>  > >
>  > >
>  > >  On Tue, Mar 17, 2009 at 10:50 AM, Ian Blavins <ib...@temenos.com>
>  > wrote:
>  > >
>  > >  > G'day
>  > >  >
>  > >  > Despite the name User Defined Variables are in fact (global) user
>  > defined
>  > >  > constants. UDVs are evaluated once prior to the run. Each UDV will
>  > take the
>  > >  > final value seen in the test plan and will not change at run time.
>  > >  >
>  > >  > You can use UDVs to initialize local variables but it is the local
>  > >  > variables whose values you have to modify during the run to achieve
>  > what you
>  > >  > have in mind. (To add to the confusion a local variable can take the
>  > same
>  > >  > name as a UDV (which will cause it to be initialized to the (static)
>  > value
>  > >  > of the UDV.) This can make it look like the UDV is varying during the
>  > run
>  > >  > but it is actually the local variable of the same name whose value is
>  > >  > changing.)
>  > >  >
>  > >  > Modifying the value of a local variable can be done in various ways
>  > >  > including with user defined parameters, by using the regular
>  > expression
>  > >  > extractor on the results of a sampler, and others.
>  > >  >
>  > >  > The manual describes all this pretty accurately but the understanding
>  > of
>  > >  > the term 'variable' is so ingrained in IT professionals that many
>  > JMeter
>  > >  > users infer, incorrectly, the operation of UDVs from the name.
>  > >  >
>  > >  >
>  > >  >
>  > >  > Ian Blavins
>  > >  > Software performance specialist
>  > >  > .
>  > >  > TEMENOS
>  > >  > The Banking Software Company
>  > >  > .
>  > >  > PeopleBuilding 2, Maylands Av
>  > >  > Hemel Hempstead   UK   HP2 4NW
>  > >  > .
>  > >  > T:  +44 (0) 1442 431 106
>  > >  > E:  iblavins@temenos.com
>  > >  > .
>  > >  > www.temenos.com
>  > >  > .
>  > >  >
>  > >  >
>  > >  > -----Original Message-----
>  > >  > From: Mark Musone [mailto:mmusone@gmail.com]
>  > >  > Sent: Tuesday, 17 March 2009 2:28 PM
>  > >  > To: jmeter-user@jakarta.apache.org
>  > >  > Subject: Using UDV in SOAP Request
>  > >  >
>  > >  > Hi All,
>  > >  >
>  > >  > I'm trying to use a User Defined Variable (I have it set to a static
>  > value
>  > >  > for now) using the WebService (SOAP) Request.
>  > >  > when I paste the XML in the SOAP/XML-RPC Data box, it works perfectly
>  > >  > fine..the variable gets substituted and sent.
>  > >  >
>  > >  > I however would like to load the XML file using the "File with SOAP
>  > XML
>  > >  > Data" field..essentially just give it the filename.
>  > >  > When I put the same exact XML in a plain text file and specify the
>  > file,
>  > >  > the
>  > >  > variable does NOT get substituted, and instead, the SOAP request gets
>  > sent
>  > >  > along as-is
>  > >  > (i.e. the ${variable} is sent literally)
>  > >  >
>  > >  > The same goes for using the "Message Folder" option, which, long term,
>  > is
>  > >  > really what i'd like to use.
>  > >  >
>  > >  > So is there something i'm missing on how to get UDV's working when
>  > >  > referencing an XML SOAP file?
>  > >  >
>  > >  > Thanks for any help,
>  > >  >
>  > >  > Mark
>  > >  > Disclaimer:
>  > >  > If you have received this e-mail in error please notify the sender.
>  > >  > Please note that any views or opinions presented in this e-mail are
>  > solely
>  > >  > those of the author and do not necessarily represent those of TEMENOS.
>  > >  > We recommend that you check this e-mail and any attachments against
>  > >  > viruses.
>  > >  > TEMENOS accepts no liability for any damage caused by any malicious
>  > code
>  > >  > or virus transmitted by this e-mail.
>  > >  >
>  > >  >
>  > >  > ---------------------------------------------------------------------
>  > >  > 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


Re: Using UDV in SOAP Request

Posted by Mark Musone <mm...@gmail.com>.
Ok, so here's my dilema..hopefully someone can give me some suggestions on a
high level what would make the most sense for JMeter to do:
I've got literally about 1000 different SOAP/XML requests, each one being
different enough to warrent being in their own file. For example, I've got a
general SOAP request to "Store a Document", Well the document can be very
many different types (PDF, word, plain text..etc..), each type has their own
properties So i've got 100 or so different "Store a Document" SOAP/XML
files, each one storing a different type.

However, for each document "type", there are properties i need to be
variable (I want a random word document name, or  if it's a JPEG image the
height and width should be random..etc..)

My original idea was going to hopefully be simple in such that in each of
these 1,000 XML files, i'd just reference a ${variable} whenever I wanted
dynamic info..all of these XML files themselves would simply be pointed to
by the "Message Folder" attribute, and JMeter'll magically pick any of the
1,000 XML files and magically do the variable substitution.

Now that I understand it's not as cut and dry, with JMeter not processing
external files, is there an JMeter-best-practices way to accomplish it?

I believe I can most likely have 1,000 SOAP request samplers (probably
inside a random controller) and copy and paste each of these XML files in
each sampler and have the variable substitution work...I guess that's the
brute force way..I'm just not sure if there's a better option. I probably
just need a pointer from the pro's of "Try this function/config"..

Thanks,
Mark



On Tue, Mar 17, 2009 at 11:04 AM, sebb <se...@gmail.com> wrote:

> On 17/03/2009, Mark Musone <mm...@gmail.com> wrote:
> > Yep, I think you hit the nail on the head..they should rename it to "User
> >  Define Constant" or "User Defined Global"!
>
> This has been made clearer in the documentation.
>
> Once the Test Plan and all UDVs have been processed, the resulting set
> of variables is copied to each thread to provide the initial set of
> variables.
>
> I.e. UDVs create regular JMeter variables, but only at test startup.
>
> >  ok, so if i understand it correctly,I basically need to put whatever
> >  function call I plan on using directly in the XML Data..
>
> Yes, or pre-create the files and use a variable file name.
>
> >  Will any of the methods you mention below work on external files, or am
> i
> >  still screwed with being able to dynamically change anything in an
> external
> >  file?
> >  Thanks,
> >
> >
> >  Mark
> >
> >
> >
> >  On Tue, Mar 17, 2009 at 10:50 AM, Ian Blavins <ib...@temenos.com>
> wrote:
> >
> >  > G'day
> >  >
> >  > Despite the name User Defined Variables are in fact (global) user
> defined
> >  > constants. UDVs are evaluated once prior to the run. Each UDV will
> take the
> >  > final value seen in the test plan and will not change at run time.
> >  >
> >  > You can use UDVs to initialize local variables but it is the local
> >  > variables whose values you have to modify during the run to achieve
> what you
> >  > have in mind. (To add to the confusion a local variable can take the
> same
> >  > name as a UDV (which will cause it to be initialized to the (static)
> value
> >  > of the UDV.) This can make it look like the UDV is varying during the
> run
> >  > but it is actually the local variable of the same name whose value is
> >  > changing.)
> >  >
> >  > Modifying the value of a local variable can be done in various ways
> >  > including with user defined parameters, by using the regular
> expression
> >  > extractor on the results of a sampler, and others.
> >  >
> >  > The manual describes all this pretty accurately but the understanding
> of
> >  > the term 'variable' is so ingrained in IT professionals that many
> JMeter
> >  > users infer, incorrectly, the operation of UDVs from the name.
> >  >
> >  >
> >  >
> >  > Ian Blavins
> >  > Software performance specialist
> >  > .
> >  > TEMENOS
> >  > The Banking Software Company
> >  > .
> >  > PeopleBuilding 2, Maylands Av
> >  > Hemel Hempstead   UK   HP2 4NW
> >  > .
> >  > T:  +44 (0) 1442 431 106
> >  > E:  iblavins@temenos.com
> >  > .
> >  > www.temenos.com
> >  > .
> >  >
> >  >
> >  > -----Original Message-----
> >  > From: Mark Musone [mailto:mmusone@gmail.com]
> >  > Sent: Tuesday, 17 March 2009 2:28 PM
> >  > To: jmeter-user@jakarta.apache.org
> >  > Subject: Using UDV in SOAP Request
> >  >
> >  > Hi All,
> >  >
> >  > I'm trying to use a User Defined Variable (I have it set to a static
> value
> >  > for now) using the WebService (SOAP) Request.
> >  > when I paste the XML in the SOAP/XML-RPC Data box, it works perfectly
> >  > fine..the variable gets substituted and sent.
> >  >
> >  > I however would like to load the XML file using the "File with SOAP
> XML
> >  > Data" field..essentially just give it the filename.
> >  > When I put the same exact XML in a plain text file and specify the
> file,
> >  > the
> >  > variable does NOT get substituted, and instead, the SOAP request gets
> sent
> >  > along as-is
> >  > (i.e. the ${variable} is sent literally)
> >  >
> >  > The same goes for using the "Message Folder" option, which, long term,
> is
> >  > really what i'd like to use.
> >  >
> >  > So is there something i'm missing on how to get UDV's working when
> >  > referencing an XML SOAP file?
> >  >
> >  > Thanks for any help,
> >  >
> >  > Mark
> >  > Disclaimer:
> >  > If you have received this e-mail in error please notify the sender.
> >  > Please note that any views or opinions presented in this e-mail are
> solely
> >  > those of the author and do not necessarily represent those of TEMENOS.
> >  > We recommend that you check this e-mail and any attachments against
> >  > viruses.
> >  > TEMENOS accepts no liability for any damage caused by any malicious
> code
> >  > or virus transmitted by this e-mail.
> >  >
> >  >
> >  > ---------------------------------------------------------------------
> >  > 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
>
>

Re: Using UDV in SOAP Request

Posted by sebb <se...@gmail.com>.
On 17/03/2009, Mark Musone <mm...@gmail.com> wrote:
> Yep, I think you hit the nail on the head..they should rename it to "User
>  Define Constant" or "User Defined Global"!

This has been made clearer in the documentation.

Once the Test Plan and all UDVs have been processed, the resulting set
of variables is copied to each thread to provide the initial set of
variables.

I.e. UDVs create regular JMeter variables, but only at test startup.

>  ok, so if i understand it correctly,I basically need to put whatever
>  function call I plan on using directly in the XML Data..

Yes, or pre-create the files and use a variable file name.

>  Will any of the methods you mention below work on external files, or am i
>  still screwed with being able to dynamically change anything in an external
>  file?
>  Thanks,
>
>
>  Mark
>
>
>
>  On Tue, Mar 17, 2009 at 10:50 AM, Ian Blavins <ib...@temenos.com> wrote:
>
>  > G'day
>  >
>  > Despite the name User Defined Variables are in fact (global) user defined
>  > constants. UDVs are evaluated once prior to the run. Each UDV will take the
>  > final value seen in the test plan and will not change at run time.
>  >
>  > You can use UDVs to initialize local variables but it is the local
>  > variables whose values you have to modify during the run to achieve what you
>  > have in mind. (To add to the confusion a local variable can take the same
>  > name as a UDV (which will cause it to be initialized to the (static) value
>  > of the UDV.) This can make it look like the UDV is varying during the run
>  > but it is actually the local variable of the same name whose value is
>  > changing.)
>  >
>  > Modifying the value of a local variable can be done in various ways
>  > including with user defined parameters, by using the regular expression
>  > extractor on the results of a sampler, and others.
>  >
>  > The manual describes all this pretty accurately but the understanding of
>  > the term 'variable' is so ingrained in IT professionals that many JMeter
>  > users infer, incorrectly, the operation of UDVs from the name.
>  >
>  >
>  >
>  > Ian Blavins
>  > Software performance specialist
>  > .
>  > TEMENOS
>  > The Banking Software Company
>  > .
>  > PeopleBuilding 2, Maylands Av
>  > Hemel Hempstead   UK   HP2 4NW
>  > .
>  > T:  +44 (0) 1442 431 106
>  > E:  iblavins@temenos.com
>  > .
>  > www.temenos.com
>  > .
>  >
>  >
>  > -----Original Message-----
>  > From: Mark Musone [mailto:mmusone@gmail.com]
>  > Sent: Tuesday, 17 March 2009 2:28 PM
>  > To: jmeter-user@jakarta.apache.org
>  > Subject: Using UDV in SOAP Request
>  >
>  > Hi All,
>  >
>  > I'm trying to use a User Defined Variable (I have it set to a static value
>  > for now) using the WebService (SOAP) Request.
>  > when I paste the XML in the SOAP/XML-RPC Data box, it works perfectly
>  > fine..the variable gets substituted and sent.
>  >
>  > I however would like to load the XML file using the "File with SOAP XML
>  > Data" field..essentially just give it the filename.
>  > When I put the same exact XML in a plain text file and specify the file,
>  > the
>  > variable does NOT get substituted, and instead, the SOAP request gets sent
>  > along as-is
>  > (i.e. the ${variable} is sent literally)
>  >
>  > The same goes for using the "Message Folder" option, which, long term, is
>  > really what i'd like to use.
>  >
>  > So is there something i'm missing on how to get UDV's working when
>  > referencing an XML SOAP file?
>  >
>  > Thanks for any help,
>  >
>  > Mark
>  > Disclaimer:
>  > If you have received this e-mail in error please notify the sender.
>  > Please note that any views or opinions presented in this e-mail are solely
>  > those of the author and do not necessarily represent those of TEMENOS.
>  > We recommend that you check this e-mail and any attachments against
>  > viruses.
>  > TEMENOS accepts no liability for any damage caused by any malicious code
>  > or virus transmitted by this e-mail.
>  >
>  >
>  > ---------------------------------------------------------------------
>  > 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


Re: Using UDV in SOAP Request

Posted by Mark Musone <mm...@gmail.com>.
Yep, I think you hit the nail on the head..they should rename it to "User
Define Constant" or "User Defined Global"!

ok, so if i understand it correctly,I basically need to put whatever
function call I plan on using directly in the XML Data..

Will any of the methods you mention below work on external files, or am i
still screwed with being able to dynamically change anything in an external
file?

Thanks,

Mark


On Tue, Mar 17, 2009 at 10:50 AM, Ian Blavins <ib...@temenos.com> wrote:

> G'day
>
> Despite the name User Defined Variables are in fact (global) user defined
> constants. UDVs are evaluated once prior to the run. Each UDV will take the
> final value seen in the test plan and will not change at run time.
>
> You can use UDVs to initialize local variables but it is the local
> variables whose values you have to modify during the run to achieve what you
> have in mind. (To add to the confusion a local variable can take the same
> name as a UDV (which will cause it to be initialized to the (static) value
> of the UDV.) This can make it look like the UDV is varying during the run
> but it is actually the local variable of the same name whose value is
> changing.)
>
> Modifying the value of a local variable can be done in various ways
> including with user defined parameters, by using the regular expression
> extractor on the results of a sampler, and others.
>
> The manual describes all this pretty accurately but the understanding of
> the term 'variable' is so ingrained in IT professionals that many JMeter
> users infer, incorrectly, the operation of UDVs from the name.
>
>
>
> Ian Blavins
> Software performance specialist
> .
> TEMENOS
> The Banking Software Company
> .
> PeopleBuilding 2, Maylands Av
> Hemel Hempstead   UK   HP2 4NW
> .
> T:  +44 (0) 1442 431 106
> E:  iblavins@temenos.com
> .
> www.temenos.com
> .
>
>
> -----Original Message-----
> From: Mark Musone [mailto:mmusone@gmail.com]
> Sent: Tuesday, 17 March 2009 2:28 PM
> To: jmeter-user@jakarta.apache.org
> Subject: Using UDV in SOAP Request
>
> Hi All,
>
> I'm trying to use a User Defined Variable (I have it set to a static value
> for now) using the WebService (SOAP) Request.
> when I paste the XML in the SOAP/XML-RPC Data box, it works perfectly
> fine..the variable gets substituted and sent.
>
> I however would like to load the XML file using the "File with SOAP XML
> Data" field..essentially just give it the filename.
> When I put the same exact XML in a plain text file and specify the file,
> the
> variable does NOT get substituted, and instead, the SOAP request gets sent
> along as-is
> (i.e. the ${variable} is sent literally)
>
> The same goes for using the "Message Folder" option, which, long term, is
> really what i'd like to use.
>
> So is there something i'm missing on how to get UDV's working when
> referencing an XML SOAP file?
>
> Thanks for any help,
>
> Mark
> Disclaimer:
> If you have received this e-mail in error please notify the sender.
> Please note that any views or opinions presented in this e-mail are solely
> those of the author and do not necessarily represent those of TEMENOS.
> We recommend that you check this e-mail and any attachments against
> viruses.
> TEMENOS accepts no liability for any damage caused by any malicious code
> or virus transmitted by this e-mail.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

RE: Using UDV in SOAP Request

Posted by Ian Blavins <ib...@temenos.com>.
G'day

Despite the name User Defined Variables are in fact (global) user defined constants. UDVs are evaluated once prior to the run. Each UDV will take the final value seen in the test plan and will not change at run time. 

You can use UDVs to initialize local variables but it is the local variables whose values you have to modify during the run to achieve what you have in mind. (To add to the confusion a local variable can take the same name as a UDV (which will cause it to be initialized to the (static) value of the UDV.) This can make it look like the UDV is varying during the run but it is actually the local variable of the same name whose value is changing.) 

Modifying the value of a local variable can be done in various ways including with user defined parameters, by using the regular expression extractor on the results of a sampler, and others.

The manual describes all this pretty accurately but the understanding of the term 'variable' is so ingrained in IT professionals that many JMeter users infer, incorrectly, the operation of UDVs from the name.



Ian Blavins
Software performance specialist
.
TEMENOS
The Banking Software Company
.
PeopleBuilding 2, Maylands Av
Hemel Hempstead   UK   HP2 4NW
.
T:  +44 (0) 1442 431 106
E:  iblavins@temenos.com
.
www.temenos.com
.


-----Original Message-----
From: Mark Musone [mailto:mmusone@gmail.com] 
Sent: Tuesday, 17 March 2009 2:28 PM
To: jmeter-user@jakarta.apache.org
Subject: Using UDV in SOAP Request

Hi All,

I'm trying to use a User Defined Variable (I have it set to a static value
for now) using the WebService (SOAP) Request.
when I paste the XML in the SOAP/XML-RPC Data box, it works perfectly
fine..the variable gets substituted and sent.

I however would like to load the XML file using the "File with SOAP XML
Data" field..essentially just give it the filename.
When I put the same exact XML in a plain text file and specify the file, the
variable does NOT get substituted, and instead, the SOAP request gets sent
along as-is
(i.e. the ${variable} is sent literally)

The same goes for using the "Message Folder" option, which, long term, is
really what i'd like to use.

So is there something i'm missing on how to get UDV's working when
referencing an XML SOAP file?

Thanks for any help,

Mark
Disclaimer:
If you have received this e-mail in error please notify the sender. 
Please note that any views or opinions presented in this e-mail are solely 
those of the author and do not necessarily represent those of TEMENOS. 
We recommend that you check this e-mail and any attachments against viruses. 
TEMENOS accepts no liability for any damage caused by any malicious code 
or virus transmitted by this e-mail.


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