You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Brian Childs <bc...@campuspartners.com> on 2006/05/01 20:52:24 UTC

Setting up User Parameters

I'm relatively new to JMeter and could use some help setting up a series of logins. I have read the User Manual (but there isn't an example supplied for this component) and combed the user group posts (I didn't find the search feature helpful enough - maybe I searched to broadly?). I have read the user list guidelines and hope I'm not breaking any rules unintentionally.
 
Similar to Massimo Forno's post below, I'd like the have JMeter login a series of 2 user names (for this example) but I don't know how to set it up. My Test Plan basically looks like:
 
Thread
  |__ Simple Controller
       |__ HTTP Request - Login
            |__ User Parameters - Login & Password
       |__ HTTP Request - View Account Info
       |__ HTTP Request - Logout
 
For "HTTP Request - Login" I have 3 parameters:
1. Name = cmd, Value = Login
2. Name = userName, Value = ${userName}
3. Name = password, Value = ${password}
 
For "User Parameters - Login & Password" I have 2 variables and 2 users:
1. Name = ${userName}, User_1 = Login1, User_2 = Login2
2. Name = ${password}, User_1 = password1, User_2 = password2
 
This isn't working as my logins fail (note: my scripts work fine without using User Parameter/variables). I haven't used variables before so this is a guess for me.
 
I will eventually want to set up Login1 - Login20 and hope to use the User Counter with a variable as advised to Massimo post.
 
Thanks for any help!
BC
________________________________

From: sebb [mailto:sebbaz@gmail.com]
Sent: Fri 4/28/06 3:19 PM
To: JMeter Users List
Subject: Re: Test Iteration

On 28/04/06, Massimo Forno <Ma...@deltatre.com> wrote:
>
> Hi,
>
> I'd like to have some suggestions for the following scenario:
>
> I need to record a web interaction using JMeter (no problem to do that) for a web application trying to insert a new person into the web application and setting some values for it.
>
> The problem arises in case I need to repeat that test, because I'd like JMeter repeat the test using different person every iteration. Let me  give you an example:
>
> I record the test inserting John Smith, then I'd like to iterate that insertion for 100 times, using John01 Smith01, John02 Smith02,...,John100 Smith100 in an automatically way.
>
> Is it possible?

Yes, but unless you want

John1 Smith1
John2 Smith2
...
John10 Smith10
...
you will have to do some extra work to add the leading zero.

Use Counter config to define a variable, e.g. N, the you can use

John${N} Smith${N}

Otherwise, just create a file containing the names, and use CSV Data
Set to read them

> Moreover, is JMeter able to read and menade asp.net hidden fields?

Probably; use the Regex Extractor to get the field values.

==

See the JMeter FAQ:

http://wiki.apache.org/jakarta-jmeter/JMeterFAQ


Re: Setting up User Parameters - variable logins using CSV

Posted by sebb <se...@gmail.com>.
You only need 1 data file.

CSV DataSet will read a new line for each user/thread, and for each
loop (if in a loop).

Try it and see


On 04/05/06, Durgs <du...@gmail.com> wrote:
>
> sebb <sebbaz <at> gmail.com> writes:
>
> >
> > On 02/05/06, Brian Childs <bchilds <at> campuspartners.com> wrote:
> > > Thanks for this! I now understand how a Counter with variables can work.
> This will be helpful when I have
> > test logins set up. Until then, I have a couple of questions about your reply
> "replace the Counter with a CSV
> > Data Set.":
> >
> > > 1.) Do you think CSV Data Set is preferred to the User Parameters Pre
> Processor I've been trying to use? (If
> > CVS works as I think it does, it's going to be much easier because of the ease
> of adding userNames & passwords.)
> >
> > Yes, unless you only have a few users.
> >
> > > 2.) For CSV Data Set, is this attaching a *.csv Filename in "HTTP Request -
> Login" and then adding a
> > Parameter Name of "userName,password"?
> >
> > You need to put the CSV Data Set at the start of the Thread Group, and
> > fill in the fields.
> >
> > No changes needed to the Sampler (unless you use different variable names).
> >
> > > 3.) For the CSV file, record the first userName & password in A1, B1, the
> second in A2, B2?
> >
> > Yes
> >
> > > Do I need to add a header row of userName password in the CSV file?
> >
> > Do not use a header.
> >
> > > 3.) Can you send me a link of where I can find more info about CSV Data Set
> in JMeter?
> >
> >
> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#CSV_Data_Set_Config
> >
> > >
> > > While I've tried a bunch of variations I'm still not able to get CSV to work
> (reminder, these tests work if I
> > put in the actual userName & password). Here are some of what I've tried:
> > >
> > > 'HTTP Request - Login'
> > >
> > >                    Name, Value
> > >                1. cmd, Login
> > >                2. userName, ${userName} (also tried "userName")
> > ${userName} is correct
> >
> > >                3. password, ${password} (also tried "password")
> > >
> > >                Send a File With the Request:
> > >                Filename: E:\JMeterScripts\Test files\userNamePassword.csv
> >
> > No, not unless you are POSTing this file
> >
> > >                Parameter Name: ${userName},${password} (also tried
> "userName,password")
> >
> > Not needed.
> >
> > > I've tried various CSV files too; below are a few examples:
> > >
> > >                james13,password
> > >                david13,password
> > >
> > >                userName,password
> > >                james13,password
> > >                david13,password
> > >
> > >                ${userName},${password}
> > No
> > >                james13,password
> > >                david13,password
> > >
> > >                james13,password,david13,password
> > >
> > >                userName,password,james13,password,david13,password
> > >                ${userName},${password},james13,password,david13,password
> > No
> > >
> > > Again, thanks any additional help. I've been working on this for a while and
> reading all kinds of posts...
> > > BC
> >
> Hi sebb,
> i have a similar but bit complex problem. i need to have 5 threads (simulated
> user) and each thread with 3 iterations. so totally, it will be 5 * 3=15 times.
> now i need to input different data on 15 iterations. how is this possible.
> frm ur previous post, i understood, we can do it for single thread with multiple
> iterations. but for multiple threads and multiple iterations, how is this
> possible. pls advice.
> i know we can have 1 csv file for each thread/user and can input data for 3
> iterations in it. so for 5 threads, do u mean we need 5 csv files.
> its not feasible for me, as i need to test for 100+ threads. so pls suggest.
>
>
>
>
>
> ---------------------------------------------------------------------
> 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: Setting up User Parameters - variable logins using CSV

Posted by Durgs <du...@gmail.com>.
sebb <sebbaz <at> gmail.com> writes:

> 
> On 02/05/06, Brian Childs <bchilds <at> campuspartners.com> wrote:
> > Thanks for this! I now understand how a Counter with variables can work.
This will be helpful when I have
> test logins set up. Until then, I have a couple of questions about your reply
"replace the Counter with a CSV
> Data Set.":
> 
> > 1.) Do you think CSV Data Set is preferred to the User Parameters Pre
Processor I've been trying to use? (If
> CVS works as I think it does, it's going to be much easier because of the ease
of adding userNames & passwords.)
> 
> Yes, unless you only have a few users.
> 
> > 2.) For CSV Data Set, is this attaching a *.csv Filename in "HTTP Request -
Login" and then adding a
> Parameter Name of "userName,password"?
> 
> You need to put the CSV Data Set at the start of the Thread Group, and
> fill in the fields.
> 
> No changes needed to the Sampler (unless you use different variable names).
> 
> > 3.) For the CSV file, record the first userName & password in A1, B1, the
second in A2, B2?
> 
> Yes
> 
> > Do I need to add a header row of userName password in the CSV file?
> 
> Do not use a header.
> 
> > 3.) Can you send me a link of where I can find more info about CSV Data Set
in JMeter?
> 
>
http://jakarta.apache.org/jmeter/usermanual/component_reference.html#CSV_Data_Set_Config
> 
> >
> > While I've tried a bunch of variations I'm still not able to get CSV to work
(reminder, these tests work if I
> put in the actual userName & password). Here are some of what I've tried:
> >
> > 'HTTP Request - Login'
> >
> >                    Name, Value
> >                1. cmd, Login
> >                2. userName, ${userName} (also tried "userName")
> ${userName} is correct
> 
> >                3. password, ${password} (also tried "password")
> >
> >                Send a File With the Request:
> >                Filename: E:\JMeterScripts\Test files\userNamePassword.csv
> 
> No, not unless you are POSTing this file
> 
> >                Parameter Name: ${userName},${password} (also tried
"userName,password")
> 
> Not needed.
> 
> > I've tried various CSV files too; below are a few examples:
> >
> >                james13,password
> >                david13,password
> >
> >                userName,password
> >                james13,password
> >                david13,password
> >
> >                ${userName},${password}
> No
> >                james13,password
> >                david13,password
> >
> >                james13,password,david13,password
> >
> >                userName,password,james13,password,david13,password
> >                ${userName},${password},james13,password,david13,password
> No
> >
> > Again, thanks any additional help. I've been working on this for a while and
reading all kinds of posts...
> > BC
> 
Hi sebb, 
i have a similar but bit complex problem. i need to have 5 threads (simulated
user) and each thread with 3 iterations. so totally, it will be 5 * 3=15 times.
now i need to input different data on 15 iterations. how is this possible.
frm ur previous post, i understood, we can do it for single thread with multiple
iterations. but for multiple threads and multiple iterations, how is this
possible. pls advice.
i know we can have 1 csv file for each thread/user and can input data for 3
iterations in it. so for 5 threads, do u mean we need 5 csv files.
its not feasible for me, as i need to test for 100+ threads. so pls suggest.





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


Re: Setting up User Parameters - variable logins using CSV

Posted by sebb <se...@gmail.com>.
On 02/05/06, Brian Childs <bc...@campuspartners.com> wrote:
> Thanks for this! I now understand how a Counter with variables can work. This will be helpful when I have test logins set up. Until then, I have a couple of questions about your reply "replace the Counter with a CSV Data Set.":

> 1.) Do you think CSV Data Set is preferred to the User Parameters Pre Processor I've been trying to use? (If CVS works as I think it does, it's going to be much easier because of the ease of adding userNames & passwords.)

Yes, unless you only have a few users.

> 2.) For CSV Data Set, is this attaching a *.csv Filename in "HTTP Request - Login" and then adding a Parameter Name of "userName,password"?

You need to put the CSV Data Set at the start of the Thread Group, and
fill in the fields.

No changes needed to the Sampler (unless you use different variable names).

> 3.) For the CSV file, record the first userName & password in A1, B1, the second in A2, B2?

Yes

> Do I need to add a header row of userName password in the CSV file?

Do not use a header.

> 3.) Can you send me a link of where I can find more info about CSV Data Set in JMeter?

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

>
> While I've tried a bunch of variations I'm still not able to get CSV to work (reminder, these tests work if I put in the actual userName & password). Here are some of what I've tried:
>
> 'HTTP Request - Login'
>
>                    Name, Value
>                1. cmd, Login
>                2. userName, ${userName} (also tried "userName")
${userName} is correct

>                3. password, ${password} (also tried "password")
>
>                Send a File With the Request:
>                Filename: E:\JMeterScripts\Test files\userNamePassword.csv

No, not unless you are POSTing this file

>                Parameter Name: ${userName},${password} (also tried "userName,password")

Not needed.

> I've tried various CSV files too; below are a few examples:
>
>                james13,password
>                david13,password
>
>                userName,password
>                james13,password
>                david13,password
>
>                ${userName},${password}
No
>                james13,password
>                david13,password
>
>                james13,password,david13,password
>
>                userName,password,james13,password,david13,password
>                ${userName},${password},james13,password,david13,password
No
>
> Again, thanks any additional help. I've been working on this for a while and reading all kinds of posts...
> BC

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


RE: Setting up User Parameters - variable logins using CSV

Posted by Brian Childs <bc...@campuspartners.com>.
Thanks for this! I now understand how a Counter with variables can work. This will be helpful when I have test logins set up. Until then, I have a couple of questions about your reply "replace the Counter with a CSV Data Set.":
 
1.) Do you think CSV Data Set is preferred to the User Parameters Pre Processor I've been trying to use? (If CVS works as I think it does, it's going to be much easier because of the ease of adding userNames & passwords.)
 
2.) For CSV Data Set, is this attaching a *.csv Filename in "HTTP Request - Login" and then adding a Parameter Name of "userName,password"?
 
3.) For the CSV file, record the first userName & password in A1, B1, the second in A2, B2? Do I need to add a header row of userName password in the CSV file?
 
3.) Can you send me a link of where I can find more info about CSV Data Set in JMeter?
 
 
While I've tried a bunch of variations I'm still not able to get CSV to work (reminder, these tests work if I put in the actual userName & password). Here are some of what I've tried:
 
'HTTP Request - Login'

		    Name, Value
		1. cmd, Login
		2. userName, ${userName} (also tried "userName")
		3. password, ${password} (also tried "password")
		 
		Send a File With the Request:
		Filename: E:\JMeterScripts\Test files\userNamePassword.csv
		Parameter Name: ${userName},${password} (also tried "userName,password")

I've tried various CSV files too; below are a few examples:

		james13,password
		david13,password
		 
		userName,password
		james13,password
		david13,password
		 
		${userName},${password}
		james13,password
		david13,password
		 
		james13,password,david13,password
		
		userName,password,james13,password,david13,password
		${userName},${password},james13,password,david13,password

Again, thanks any additional help. I've been working on this for a while and reading all kinds of posts...
BC

________________________________

From: sebb [mailto:sebbaz@gmail.com]
Sent: Mon 5/1/06 4:54 PM
To: JMeter Users List
Subject: Re: Setting up User Parameters

Try

Thread
 |__ Simple Controller
      |__ Counter
      |__ HTTP Request - Login
      |__ HTTP Request - View Account Info
      |__ HTTP Request - Logout

Set the Counter parameters as follows:
Start 1
Inc 1
Max 20 (or whatever)
Reference Name: NO
Track Counter Independently for each User should _not_ be enabled

Set the Login parameters as follows:

2. Name = userName, Value = Login${NO}
3. Name = password, Value = password${NO}

Or you can replace the Counter with a CSV Data Set, and set the
Variable Names to:

userName,password

in which case your existing login should work.

S
On 01/05/06, Brian Childs <bc...@campuspartners.com> wrote:
> I'm relatively new to JMeter and could use some help setting up a series of logins. I have read the User Manual (but there isn't an example supplied for this component) and combed the user group posts (I didn't find the search feature helpful enough - maybe I searched to broadly?). I have read the user list guidelines and hope I'm not breaking any rules unintentionally.
>
> Similar to Massimo Forno's post below, I'd like the have JMeter login a series of 2 user names (for this example) but I don't know how to set it up. My Test Plan basically looks like:
>
> Thread
>   |__ Simple Controller
>        |__ HTTP Request - Login
>             |__ User Parameters - Login & Password
>        |__ HTTP Request - View Account Info
>        |__ HTTP Request - Logout
>
> For "HTTP Request - Login" I have 3 parameters:
> 1. Name = cmd, Value = Login
> 2. Name = userName, Value = ${userName}
> 3. Name = password, Value = ${password}
>
> For "User Parameters - Login & Password" I have 2 variables and 2 users:
> 1. Name = ${userName}, User_1 = Login1, User_2 = Login2
> 2. Name = ${password}, User_1 = password1, User_2 = password2
>
> This isn't working as my logins fail (note: my scripts work fine without using User Parameter/variables). I haven't used variables before so this is a guess for me.
>
> I will eventually want to set up Login1 - Login20 and hope to use the User Counter with a variable as advised to Massimo post.
>
> Thanks for any help!
> BC


Re: Setting up User Parameters

Posted by sebb <se...@gmail.com>.
Try

Thread
 |__ Simple Controller
      |__ Counter
      |__ HTTP Request - Login
      |__ HTTP Request - View Account Info
      |__ HTTP Request - Logout

Set the Counter parameters as follows:
Start 1
Inc 1
Max 20 (or whatever)
Reference Name: NO
Track Counter Independently for each User should _not_ be enabled

Set the Login parameters as follows:

2. Name = userName, Value = Login${NO}
3. Name = password, Value = password${NO}

Or you can replace the Counter with a CSV Data Set, and set the
Variable Names to:

userName,password

in which case your existing login should work.

S
On 01/05/06, Brian Childs <bc...@campuspartners.com> wrote:
> I'm relatively new to JMeter and could use some help setting up a series of logins. I have read the User Manual (but there isn't an example supplied for this component) and combed the user group posts (I didn't find the search feature helpful enough - maybe I searched to broadly?). I have read the user list guidelines and hope I'm not breaking any rules unintentionally.
>
> Similar to Massimo Forno's post below, I'd like the have JMeter login a series of 2 user names (for this example) but I don't know how to set it up. My Test Plan basically looks like:
>
> Thread
>   |__ Simple Controller
>        |__ HTTP Request - Login
>             |__ User Parameters - Login & Password
>        |__ HTTP Request - View Account Info
>        |__ HTTP Request - Logout
>
> For "HTTP Request - Login" I have 3 parameters:
> 1. Name = cmd, Value = Login
> 2. Name = userName, Value = ${userName}
> 3. Name = password, Value = ${password}
>
> For "User Parameters - Login & Password" I have 2 variables and 2 users:
> 1. Name = ${userName}, User_1 = Login1, User_2 = Login2
> 2. Name = ${password}, User_1 = password1, User_2 = password2
>
> This isn't working as my logins fail (note: my scripts work fine without using User Parameter/variables). I haven't used variables before so this is a guess for me.
>
> I will eventually want to set up Login1 - Login20 and hope to use the User Counter with a variable as advised to Massimo post.
>
> Thanks for any help!
> BC
> ________________________________
>
> From: sebb [mailto:sebbaz@gmail.com]
> Sent: Fri 4/28/06 3:19 PM
> To: JMeter Users List
> Subject: Re: Test Iteration
>
> On 28/04/06, Massimo Forno <Ma...@deltatre.com> wrote:
> >
> > Hi,
> >
> > I'd like to have some suggestions for the following scenario:
> >
> > I need to record a web interaction using JMeter (no problem to do that) for a web application trying to insert a new person into the web application and setting some values for it.
> >
> > The problem arises in case I need to repeat that test, because I'd like JMeter repeat the test using different person every iteration. Let me  give you an example:
> >
> > I record the test inserting John Smith, then I'd like to iterate that insertion for 100 times, using John01 Smith01, John02 Smith02,...,John100 Smith100 in an automatically way.
> >
> > Is it possible?
>
> Yes, but unless you want
>
> John1 Smith1
> John2 Smith2
> ...
> John10 Smith10
> ...
> you will have to do some extra work to add the leading zero.
>
> Use Counter config to define a variable, e.g. N, the you can use
>
> John${N} Smith${N}
>
> Otherwise, just create a file containing the names, and use CSV Data
> Set to read them
>
> > Moreover, is JMeter able to read and menade asp.net hidden fields?
>
> Probably; use the Regex Extractor to get the field values.
>
> ==
>
> See the JMeter FAQ:
>
> http://wiki.apache.org/jakarta-jmeter/JMeterFAQ
>
>
>
> ---------------------------------------------------------------------
> 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