You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Scott Cederberg <ce...@gmail.com> on 2007/03/27 03:33:23 UTC

Writing user variables to a file

Hi JMeter folks,

    Is there a straightforward way to have JMeter write the contents
of a user variable to a results file (e.g., the one produced by the
Simple Data Writer Listener)?  I'd like to parse out a field or two
using, e.g., a Regular Expression Extractor, and write those to a file
for later use.

    Thanks for your help.


                     Scott

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


Re: CSV Data set config problems

Posted by sebb <se...@gmail.com>.
In that case, either variable is misspelt, or there is some other
error  - check jmeter.log.

On 27/03/07, Josh Feldman <jo...@eons.com> wrote:
> I am using the csv data set in the sampler not in the request default.
>
> The sampler is not picking up the variable.
>
> Josh
>
> -----Original Message-----
> From: sebb [mailto:sebbaz@gmail.com]
> Sent: Tuesday, March 27, 2007 1:08 PM
> To: JMeter Users List
> Subject: Re: CSV Data set config problems
>
> CSV DataSet does not read from the file until after Config elements
> such as the HTTP Request default test element, so the variable is not
> available until too late.
>
> CSV Dataset is intended for samplers that need lots of variable data.
>
> Best to use properties instead, and refer to them with the __P()
> function on the HTTP RD element.
>
> Properties can be defined on the command-line, in jmeter.properties or
> in user.properties.
>
> S.
>
> On 27/03/07, Josh Feldman <jo...@eons.com> wrote:
> > Yeah that was a typo. This is what is set up
> >
> > Thread Group
> >        http request default
> >        CSV Data set config
> >        http sampler
> >        View results Tree
> >
> > no controllers.
> >
> > -----Original Message-----
> > From: Christensen, Alan [mailto:alan.christensen@hp.com]
> > Sent: Tuesday, March 27, 2007 12:24 PM
> > To: JMeter Users List
> > Subject: RE: CSV Data set config problems
> >
> > I am assuming that the difference between the variable names (terms)
> and
> > the $(term) is a typo.  If not, then you need to fix this.
> >
> > Is the csv configuration element within the loop containing the
> > reference?
> >
> > -----Original Message-----
> > From: Josh Feldman [mailto:josh@eons.com]
> > Sent: Tuesday, March 27, 2007 9:05 AM
> > To: JMeter Users List
> > Subject: CSV Data set config problems
> >
> > I have used this function in the past. Going back the scripts that
> were
> > working, currently are not.
> >
> > I am working from the GUI.
> >
> > I set up the CSV Data set config:
> >
> > Filename = abc.csv
> > Variable names = terms
> > Delimiter = ,
> > EOF = true
> >
> > In the http sampler I have the parameter set q = ${term}
> >
> > I have the file abc.csv in the jmeter bin directory. ABC is a dummy
> > file, I made in excel: A on one line, B on the second, and so forth.
> > Saved in csv format.
> >
> > When I run the script the request is GET
> > http://www.google.com/search?q=${terms}, and it doesn't seem to be
> > reading the file.
> >
> > I downloaded Jmeter again, and got the same result.
> >
> > Any suggestions?
> >
> > Josh Feldman
> >
> > ---------------------------------------------------------------------
> > 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
> >
> >
>
> ---------------------------------------------------------------------
> 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: CSV Data set config problems

Posted by Josh Feldman <jo...@eons.com>.
I am using the csv data set in the sampler not in the request default. 

The sampler is not picking up the variable.

Josh

-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com] 
Sent: Tuesday, March 27, 2007 1:08 PM
To: JMeter Users List
Subject: Re: CSV Data set config problems

CSV DataSet does not read from the file until after Config elements
such as the HTTP Request default test element, so the variable is not
available until too late.

CSV Dataset is intended for samplers that need lots of variable data.

Best to use properties instead, and refer to them with the __P()
function on the HTTP RD element.

Properties can be defined on the command-line, in jmeter.properties or
in user.properties.

S.

On 27/03/07, Josh Feldman <jo...@eons.com> wrote:
> Yeah that was a typo. This is what is set up
>
> Thread Group
>        http request default
>        CSV Data set config
>        http sampler
>        View results Tree
>
> no controllers.
>
> -----Original Message-----
> From: Christensen, Alan [mailto:alan.christensen@hp.com]
> Sent: Tuesday, March 27, 2007 12:24 PM
> To: JMeter Users List
> Subject: RE: CSV Data set config problems
>
> I am assuming that the difference between the variable names (terms)
and
> the $(term) is a typo.  If not, then you need to fix this.
>
> Is the csv configuration element within the loop containing the
> reference?
>
> -----Original Message-----
> From: Josh Feldman [mailto:josh@eons.com]
> Sent: Tuesday, March 27, 2007 9:05 AM
> To: JMeter Users List
> Subject: CSV Data set config problems
>
> I have used this function in the past. Going back the scripts that
were
> working, currently are not.
>
> I am working from the GUI.
>
> I set up the CSV Data set config:
>
> Filename = abc.csv
> Variable names = terms
> Delimiter = ,
> EOF = true
>
> In the http sampler I have the parameter set q = ${term}
>
> I have the file abc.csv in the jmeter bin directory. ABC is a dummy
> file, I made in excel: A on one line, B on the second, and so forth.
> Saved in csv format.
>
> When I run the script the request is GET
> http://www.google.com/search?q=${terms}, and it doesn't seem to be
> reading the file.
>
> I downloaded Jmeter again, and got the same result.
>
> Any suggestions?
>
> Josh Feldman
>
> ---------------------------------------------------------------------
> 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
>
>

---------------------------------------------------------------------
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: CSV Data set config problems

Posted by sebb <se...@gmail.com>.
CSV DataSet does not read from the file until after Config elements
such as the HTTP Request default test element, so the variable is not
available until too late.

CSV Dataset is intended for samplers that need lots of variable data.

Best to use properties instead, and refer to them with the __P()
function on the HTTP RD element.

Properties can be defined on the command-line, in jmeter.properties or
in user.properties.

S.

On 27/03/07, Josh Feldman <jo...@eons.com> wrote:
> Yeah that was a typo. This is what is set up
>
> Thread Group
>        http request default
>        CSV Data set config
>        http sampler
>        View results Tree
>
> no controllers.
>
> -----Original Message-----
> From: Christensen, Alan [mailto:alan.christensen@hp.com]
> Sent: Tuesday, March 27, 2007 12:24 PM
> To: JMeter Users List
> Subject: RE: CSV Data set config problems
>
> I am assuming that the difference between the variable names (terms) and
> the $(term) is a typo.  If not, then you need to fix this.
>
> Is the csv configuration element within the loop containing the
> reference?
>
> -----Original Message-----
> From: Josh Feldman [mailto:josh@eons.com]
> Sent: Tuesday, March 27, 2007 9:05 AM
> To: JMeter Users List
> Subject: CSV Data set config problems
>
> I have used this function in the past. Going back the scripts that were
> working, currently are not.
>
> I am working from the GUI.
>
> I set up the CSV Data set config:
>
> Filename = abc.csv
> Variable names = terms
> Delimiter = ,
> EOF = true
>
> In the http sampler I have the parameter set q = ${term}
>
> I have the file abc.csv in the jmeter bin directory. ABC is a dummy
> file, I made in excel: A on one line, B on the second, and so forth.
> Saved in csv format.
>
> When I run the script the request is GET
> http://www.google.com/search?q=${terms}, and it doesn't seem to be
> reading the file.
>
> I downloaded Jmeter again, and got the same result.
>
> Any suggestions?
>
> Josh Feldman
>
> ---------------------------------------------------------------------
> 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
>
>

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


RE: CSV Data set config problems

Posted by Josh Feldman <jo...@eons.com>.
Yeah that was a typo. This is what is set up

Thread Group
	http request default
	CSV Data set config
	http sampler
	View results Tree

no controllers.

-----Original Message-----
From: Christensen, Alan [mailto:alan.christensen@hp.com] 
Sent: Tuesday, March 27, 2007 12:24 PM
To: JMeter Users List
Subject: RE: CSV Data set config problems

I am assuming that the difference between the variable names (terms) and
the $(term) is a typo.  If not, then you need to fix this.

Is the csv configuration element within the loop containing the
reference? 

-----Original Message-----
From: Josh Feldman [mailto:josh@eons.com] 
Sent: Tuesday, March 27, 2007 9:05 AM
To: JMeter Users List
Subject: CSV Data set config problems

I have used this function in the past. Going back the scripts that were
working, currently are not.

I am working from the GUI.

I set up the CSV Data set config:

Filename = abc.csv
Variable names = terms
Delimiter = ,
EOF = true

In the http sampler I have the parameter set q = ${term}

I have the file abc.csv in the jmeter bin directory. ABC is a dummy
file, I made in excel: A on one line, B on the second, and so forth.
Saved in csv format.

When I run the script the request is GET
http://www.google.com/search?q=${terms}, and it doesn't seem to be
reading the file.

I downloaded Jmeter again, and got the same result.

Any suggestions?

Josh Feldman

---------------------------------------------------------------------
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: CSV Data set config problems

Posted by "Christensen, Alan" <al...@hp.com>.
I am assuming that the difference between the variable names (terms) and
the $(term) is a typo.  If not, then you need to fix this.

Is the csv configuration element within the loop containing the
reference? 

-----Original Message-----
From: Josh Feldman [mailto:josh@eons.com] 
Sent: Tuesday, March 27, 2007 9:05 AM
To: JMeter Users List
Subject: CSV Data set config problems

I have used this function in the past. Going back the scripts that were
working, currently are not.

I am working from the GUI.

I set up the CSV Data set config:

Filename = abc.csv
Variable names = terms
Delimiter = ,
EOF = true

In the http sampler I have the parameter set q = ${term}

I have the file abc.csv in the jmeter bin directory. ABC is a dummy
file, I made in excel: A on one line, B on the second, and so forth.
Saved in csv format.

When I run the script the request is GET
http://www.google.com/search?q=${terms}, and it doesn't seem to be
reading the file.

I downloaded Jmeter again, and got the same result.

Any suggestions?

Josh Feldman

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


CSV Data set config problems

Posted by Josh Feldman <jo...@eons.com>.
I have used this function in the past. Going back the scripts that were
working, currently are not.

I am working from the GUI.

I set up the CSV Data set config:

Filename = abc.csv
Variable names = terms
Delimiter = ,
EOF = true

In the http sampler I have the parameter set
q = ${term}

I have the file abc.csv in the jmeter bin directory. ABC is a dummy
file, I made in excel: A on one line, B on the second, and so forth.
Saved in csv format.

When I run the script the request is GET
http://www.google.com/search?q=${terms}, and it doesn't seem to be
reading the file.

I downloaded Jmeter again, and got the same result.

Any suggestions?

Josh Feldman

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


Re: Writing user variables to a file

Posted by sebb <se...@gmail.com>.
You can include a variable in a sampler field (e.g. the title) and
then it will appear in the results file.

Or you can use __log() or __logn() to write to jmeter.log.

This has been requested before, but is not implemented.

S///
On 27/03/07, Scott Cederberg <ce...@gmail.com> wrote:
> Hi JMeter folks,
>
>    Is there a straightforward way to have JMeter write the contents
> of a user variable to a results file (e.g., the one produced by the
> Simple Data Writer Listener)?  I'd like to parse out a field or two
> using, e.g., a Regular Expression Extractor, and write those to a file
> for later use.
>
>    Thanks for your help.
>
>
>                     Scott
>
> ---------------------------------------------------------------------
> 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