You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Garvita <ga...@tcs.com> on 2010/09/09 11:36:49 UTC

How to refer to a value stored in afile

Hi All,

I want to refer to various values stored in a file, how can i do that.
for eg 
name=abc 
subj=def
address=xyz
are stored in a file,how can i retrieve them in a jmeter test script when i
am passing file using command line arguments (option -q).

-- 
View this message in context: http://jmeter.512774.n5.nabble.com/How-to-refer-to-a-value-stored-in-afile-tp2827183p2827183.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


RE: How to refer to a value stored in afile

Posted by Jens Müller <je...@hotmail.com>.

> the easiest approach might be to convert your data to CSV, then use the
> appropriate Config Element in your Test Plan.

Keep in mind the restrictions of this config element when run in distributed mode. Each client needs its own file.

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


Re: How to refer to a value stored in afile

Posted by Felix Frank <ff...@mpexnet.de>.
Hi,

the easiest approach might be to convert your data to CSV, then use the
appropriate Config Element in your Test Plan.

Cheers,
Felix

On 09/09/10 11:36, Garvita wrote:
> 
> Hi All,
> 
> I want to refer to various values stored in a file, how can i do that.
> for eg 
> name=abc 
> subj=def
> address=xyz
> are stored in a file,how can i retrieve them in a jmeter test script when i
> am passing file using command line arguments (option -q).

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


Re: How to refer to a value stored in afile

Posted by sebb <se...@gmail.com>.
On 9 September 2010 12:11, Garvita <ga...@tcs.com> wrote:
>
> But I want to refer to value with the help of variable name,so i dont think i
> can use CSV

Have you read:

http://jakarta.apache.org/jmeter/usermanual/component_reference.html#CSV_Data_Set_Config

> One thing i read is __StringFromFile but I am not able to use
> that, can u may help me.
> --
> View this message in context: http://jmeter.512774.n5.nabble.com/How-to-refer-to-a-value-stored-in-afile-tp2827183p2827282.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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: How to refer to a value stored in afile

Posted by Fazal Syed Ali <sy...@gmail.com>.
Garvita,

You can use CSV file, retrieve the values in your JMeter test plan and
pass the file name on the command line. Use the steps given below to
achieve this:

1. Add CSV Data Set Config to your test plan or thread group.

2. In the file name field introduce a variable like this
${__P(your-variable-name)}
    Make sure it's in the above format.

3. Enter just one variable name in Variable Names field. You can refer
to this variable in the rest of your test case.

4. In the delimiter field enter '='

5. While running the test from command line, pass the following
additional parameter to specify the path of the file:
     -Dyour-variable-name=<path_to_the_data_file>


The following plug-in might be of help to you if you are looking for
parameterizing subroutines.

http://code.google.com/p/jmeter-plugins/wiki/ParameterizedController

--Fazal

On Thu, Sep 9, 2010 at 6:11 AM, Garvita <ga...@tcs.com> wrote:
>
> But I want to refer to value with the help of variable name,so i dont think i
> can use CSV, One thing i read is __StringFromFile but I am not able to use
> that, can u may help me.
> --
> View this message in context: http://jmeter.512774.n5.nabble.com/How-to-refer-to-a-value-stored-in-afile-tp2827183p2827282.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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: How to refer to a value stored in afile

Posted by Fazal Syed Ali <sy...@gmail.com>.
Garvita,

You can use CSV file, retrieve the values in your JMeter test plan and
pass the file name on the command line. Use the steps given below to
achieve this:

1. Add CSV Data Set Config to your test plan or thread group.

2. In the file name field introduce a variable like this
${__P(your-variable-name)}
   Make sure it's in the above format.

3. Enter just one variable name in Variable Names field. You can refer
to this variable in the rest of your test case.

4. In the delimiter field enter '='

5. While running the test from command line, pass the following
additional parameter to specify the path of the file:
    -Dyour-variable-name=<path_to_the_data_file>


The following plug-in might be of help to you if you are looking for
parameterizing subroutines.

http://code.google.com/p/jmeter-plugins/wiki/ParameterizedController

--Fazal

On Thu, Sep 9, 2010 at 6:11 AM, Garvita <ga...@tcs.com> wrote:
>
> But I want to refer to value with the help of variable name,so i dont think i
> can use CSV, One thing i read is __StringFromFile but I am not able to use
> that, can u may help me.
> --
> View this message in context: http://jmeter.512774.n5.nabble.com/How-to-refer-to-a-value-stored-in-afile-tp2827183p2827282.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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: How to refer to a value stored in afile

Posted by Garvita <ga...@tcs.com>.
But I want to refer to value with the help of variable name,so i dont think i
can use CSV, One thing i read is __StringFromFile but I am not able to use
that, can u may help me.
-- 
View this message in context: http://jmeter.512774.n5.nabble.com/How-to-refer-to-a-value-stored-in-afile-tp2827183p2827282.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: How to refer to a value stored in afile

Posted by Felix Frank <ff...@mpexnet.de>.
You will probably need to define a static mapping of
var-name => CSV-field-index

If not all variables are set in each block of data, some or many of your
CSV lines will contain empty columns.

HTH,
Felix

On 09/09/10 12:54, Garvita wrote:
> 
> The variable names in file are different then how can i use csv,Please let me
> know

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


Re: How to refer to a value stored in afile

Posted by Garvita <ga...@tcs.com>.
The variable names in file are different then how can i use csv,Please let me
know
-- 
View this message in context: http://jmeter.512774.n5.nabble.com/How-to-refer-to-a-value-stored-in-afile-tp2827183p2827258.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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