You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Bhanu <iy...@yahoo.com> on 2005/11/14 11:27:09 UTC

reading input from file

* created a 'test.csv' file  as  
 
fred,password,
bob,pass2,
terry,pass3

* The test plan has the following elements in the order as below:
 
-CSV Data Set Config : used test.csv as filename,  'username,password' as variable names
-User Defined Variables : added two variables - username and password in the Name column.
-HTTP Request Defaults : with protocol and Server Name
-HTTP request : with the path  for login web page, GET method and parameters Name as 'username, password, login'  with Values '${username}, ${password}, 1'
-HTTP Cookie Manager.
 
It doesn't work. It doesnt read data from the file. The log file shows
 
<sampleResult timeStamp="1131960994017" dataType="text" threadName="test 1-1" label="Login Request" time="20987" responseMessage="Non HTTP response message" responseCode="Non HTTP response code" success="false"><property xml:space="preserve" name="samplerData">GET https://www.sitestuff.com:443/hypertork/performLogin?username=&amp;password=&amp;login=1
 
Wherez it going wrong?
 
NP: The test plan works when i provide values to the user variables rather than asking it to read from file.
 
thanx,
Bhanu
 
 
 
 
 

James Bull <jb...@thoughtworks.com> wrote:


You should use two config elements
right click --> add --> config element --> CSV Data Set config
right click --> add --> config element --> User Defined variables

The data set config allows you to specify the file you wish to use and the
variable names to read the values into.

The User defined variables allows you to define the variables referred to
by data set config.

Finally you refer to the vaiables in the parameters section of the http
request by enclosing the variable name in ${}

For example your file is like this,

fred,password,
bob,pass2,
terry,pass3

You enter the file name into the Filename field. The path is relative to
the directory your script is in.

Into the Variable names field add 'username,password'.

You add username and password to the user defined variables page.

You refer to ${username} and ${password} in the parameters section of the
httpsampler.

Each time the script performs another iteration the next line will
automatically be read from the file.

James

-----Bhanu wrote: -----

To: jmeter-user@jakarta.apache.org
From: Bhanu 
Date: 11/11/2005 03:28PM
Subject: help needed

Hi,
>
> i'm a fresher to JMeter and have learnt to create
basic test scripts.
I need to create a JMeter script that will automate
> user creation process on a website. There are 2
> main steps in the user creation process. First,
you
> "register" the user with the website. Next, you
> have to log in as administrator and approve the
user's registration. In this task, i will have to
read in data from a flat file. The eventual file will
have a list of user names and passwords on each line -
and
> i shud use these values dynamically in the script
each iteration.

Pls suggest how could this task be accomplished using
JMeter GUI tool.
>
> Thanks so much in
> advance.
>
> -Bhanu

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.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



		
---------------------------------
 Yahoo! FareChase - Search multiple travel sites in one click.  

Re: RE reading input from file

Posted by Bhanu <iy...@yahoo.com>.
thanx for the prompt reply..however this doesnt work either.
 
result from assertion listener  is as follows:
 
GET https://www.sitestuff.com:443/hypertork/performLogin?username=&password=&login=1
 
thanx,
Bhanu.


jerome.dupont@bnf.fr wrote:
Try this, setting CSV Data Set Config element as subelement of your http
request, and not at the beginning of your test plan.

-HTTP request : with the path for login web page, GET method and
parameters Name as 'username, password, login' with Values '${username},
${password}, 1'
|
-CSV Data Set Config : used test.csv as filename,
'username,password' as variable names

Regards,
Jérôme
|----------->
| |
| |
| |
| |
| |
|----------->
>-----------------------------------------------------------------------------------------------------------------------------------------------|
| |
| |
| Message de : Bhanu |
| 14/11/2005 11:27 |
| |
| |
| |
| |
| |
| Veuillez répondre à "JMeter Users List" |
| |
| |
| |
| |
| |
| |
| |
| Pour|
| JMeter Users List |
| Copie|
| |
| Objet|
| reading input from file |
| |
>-----------------------------------------------------------------------------------------------------------------------------------------------|




* created a 'test.csv' file as

fred,password,
bob,pass2,
terry,pass3

* The test plan has the following elements in the order as below:

-CSV Data Set Config : used test.csv as filename, 'username,password' as
variable names
-User Defined Variables : added two variables - username and password in
the Name column.
-HTTP Request Defaults : with protocol and Server Name
-HTTP request : with the path for login web page, GET method and
parameters Name as 'username, password, login' with Values '${username},
${password}, 1'
-HTTP Cookie Manager.

It doesn't work. It doesnt read data from the file. The log file shows

message" time="20987" label="Login Request" threadName="test
1-1" dataType="text" timeStamp="1131960994017">
xml:space="preserve" name="samplerData">GET
https://www.sitestuff.com:443/hypertork/performLogin?username=&password=&login=1


Wherez it going wrong?

NP: The test plan works when i provide values to the user variables rather
than asking it to read from file.

thanx,
Bhanu






James Bull wrote:


You should use two config elements
right click --> add --> config element --> CSV Data Set config
right click --> add --> config element --> User Defined variables

The data set config allows you to specify the file you wish to use and the
variable names to read the values into.

The User defined variables allows you to define the variables referred to
by data set config.

Finally you refer to the vaiables in the parameters section of the http
request by enclosing the variable name in ${}

For example your file is like this,

fred,password,
bob,pass2,
terry,pass3

You enter the file name into the Filename field. The path is relative to
the directory your script is in.

Into the Variable names field add 'username,password'.

You add username and password to the user defined variables page.

You refer to ${username} and ${password} in the parameters section of the
httpsampler.

Each time the script performs another iteration the next line will
automatically be read from the file.

James

-----Bhanu wrote: -----

To: jmeter-user@jakarta.apache.org
From: Bhanu
Date: 11/11/2005 03:28PM
Subject: help needed

Hi,
>
> i'm a fresher to JMeter and have learnt to create
basic test scripts.
I need to create a JMeter script that will automate
> user creation process on a website. There are 2
> main steps in the user creation process. First,
you
> "register" the user with the website. Next, you
> have to log in as administrator and approve the
user's registration. In this task, i will have to
read in data from a flat file. The eventual file will
have a list of user names and passwords on each line -
and
> i shud use these values dynamically in the script
each iteration.

Pls suggest how could this task be accomplished using
JMeter GUI tool.
>
> Thanks so much in
> advance.
>
> -Bhanu

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.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




---------------------------------
Yahoo! FareChase - Search multiple travel sites in one click.




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


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

RE reading input from file

Posted by je...@bnf.fr.
Try this, setting CSV Data Set Config element as subelement of your http
request, and not at the beginning of your test plan.

-HTTP request : with the path  for login web page, GET method and
parameters Name as 'username, password, login'  with Values '${username},
${password}, 1'
      |
      -CSV Data Set Config : used test.csv as filename,
'username,password' as variable names

Regards,
Jérôme
|----------->
|           |
|           |
|           |
|           |
|           |
|----------->
  >-----------------------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                                                                               |
  |                                                                                                                                               |
  |  Message de : Bhanu <iy...@yahoo.com>                                                                                                    |
  |                        14/11/2005 11:27                                                                                                       |
  |                                                                                                                                               |
  |                                                                                                                                               |
  |                                                                                                                                               |
  |                                                                                                                                               |
  |                                                                                                                                               |
  |                                   Veuillez répondre à "JMeter Users List" <jm...@jakarta.apache.org>                                    |
  |                                                                                                                                               |
  |                                                                                                                                               |
  |                                                                                                                                               |
  |                                                                                                                                               |
  |                                                                                                                                               |
  |                                                                                                                                               |
  |                                                                                                                                               |
  |                                                                                                                                           Pour|
  |           JMeter Users List <jm...@jakarta.apache.org>                                                                                  |
  |                                                                                                                                          Copie|
  |                                                                                                                                               |
  |                                                                                                                                          Objet|
  |           reading input from file                                                                                                             |
  |                                                                                                                                               |
  >-----------------------------------------------------------------------------------------------------------------------------------------------|




* created a 'test.csv' file  as

fred,password,
bob,pass2,
terry,pass3

* The test plan has the following elements in the order as below:

-CSV Data Set Config : used test.csv as filename,  'username,password' as
variable names
-User Defined Variables : added two variables - username and password in
the Name column.
-HTTP Request Defaults : with protocol and Server Name
-HTTP request : with the path  for login web page, GET method and
parameters Name as 'username, password, login'  with Values '${username},
${password}, 1'
-HTTP Cookie Manager.

It doesn't work. It doesnt read data from the file. The log file shows

<sampleResult timeStamp="1131960994017" dataType="text" threadName="test
1-1" label="Login Request" time="20987" responseMessage="Non HTTP response
message" responseCode="Non HTTP response code" success="false"><property
xml:space="preserve" name="samplerData">GET
https://www.sitestuff.com:443/hypertork/performLogin?username=&amp;password=&amp;login=1


Wherez it going wrong?

NP: The test plan works when i provide values to the user variables rather
than asking it to read from file.

thanx,
Bhanu






James Bull <jb...@thoughtworks.com> wrote:


You should use two config elements
right click --> add --> config element --> CSV Data Set config
right click --> add --> config element --> User Defined variables

The data set config allows you to specify the file you wish to use and the
variable names to read the values into.

The User defined variables allows you to define the variables referred to
by data set config.

Finally you refer to the vaiables in the parameters section of the http
request by enclosing the variable name in ${}

For example your file is like this,

fred,password,
bob,pass2,
terry,pass3

You enter the file name into the Filename field. The path is relative to
the directory your script is in.

Into the Variable names field add 'username,password'.

You add username and password to the user defined variables page.

You refer to ${username} and ${password} in the parameters section of the
httpsampler.

Each time the script performs another iteration the next line will
automatically be read from the file.

James

-----Bhanu wrote: -----

To: jmeter-user@jakarta.apache.org
From: Bhanu
Date: 11/11/2005 03:28PM
Subject: help needed

Hi,
>
> i'm a fresher to JMeter and have learnt to create
basic test scripts.
I need to create a JMeter script that will automate
> user creation process on a website. There are 2
> main steps in the user creation process. First,
you
> "register" the user with the website. Next, you
> have to log in as administrator and approve the
user's registration. In this task, i will have to
read in data from a flat file. The eventual file will
have a list of user names and passwords on each line -
and
> i shud use these values dynamically in the script
each iteration.

Pls suggest how could this task be accomplished using
JMeter GUI tool.
>
> Thanks so much in
> advance.
>
> -Bhanu

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.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




 ---------------------------------
 Yahoo! FareChase - Search multiple travel sites in one click.




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