You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Jeff Ohrstrom <jo...@hotmail.com> on 2014/07/01 07:29:52 UTC

Re: Using multiple CSV files and Multiple HTTP requests for one User in a Thread Group

That is my mistake, there are no collisions when you share the file1.csv
across all threads, but will be if you share in current thread. I made
this thread more complicated than it needs to be, in fact you don't even
need your first loop controller at all because the CSV Data Set Config
does all the work for you in dividing out 100 data lines across 100
threads. 

On Mon, 2014-06-30 at 22:04 +0700, Tien Huynh wrote:
> Hi Jeff,
> 
> Not sure if I understand your comments fully. But eere is what I was trying to say:
> 
> 	Thread Group
> 		Loop Controller (loop count =100)   
> 			CSV Data Set Config (file1.csv, 100 users)
> 			Loop Controller (loop count =500)
> 				CSV Data Set Config (file2.csv, 500 users)
> 				HTTP Request
> 
> With this, each and every user in file1.csv will go thru all 500 users in file2.csv. I'm not able to find any collision here.
> 
> Regards,
> Tien
> 
> -----Original Message-----
> From: Jeff Ohrstrom [mailto:johrstrom@hotmail.com] 
> Sent: Monday, June 30, 2014 11:37 AM
> To: JMeter Users List
> Subject: Re: Using multiple CSV files and Multiple HTTP requests for one User in a Thread Group
> 
> That is a more elegant solution, but does not protect you from collisions.  That is, Thread N is going to use User A (from file1.csv) while Thread M is also using User A userid/password. Especially with a
> 1:1 mapping of threads:set of user/password combinations you're likely to have a lot of collisions.  
> 
> On Mon, 2014-06-30 at 09:43 +0700, Tien Huynh wrote:
> > Kajari,
> > 
> > I would use nested loops. One Loop Controller for file2.csv (loop 500 
> > tines) inside the Loop Controller for file1.csv (loop 100 times). 
> > Doing so, each user in file1.csv will go over 500 rows in file2.csv
> > 
> > Regards,
> > Tien
> > 
> > -----Original Message-----
> > From: Jeff Ohrstrom [mailto:johrstrom@hotmail.com]
> > Sent: Monday, June 30, 2014 2:13 AM
> > To: user@jmeter.apache.org
> > Subject: Re: Using multiple CSV files and Multiple HTTP requests for 
> > one User in a Thread Group
> > 
> > Kajari,
> > 
> > The implementation of this is simple.  For the first file (file1.csv) 
> > you simply need to override what Jmeter picks up out of the file with 
> > a
> > JRS223 or BSF pre processor.  That is, Jmeter divides out rows from 
> > csv files on a first come first serve basis.  But you want to be sure 
> > that the Nth thread to have the Nth record from the file. To do this 
> > in the pre-processor element you can use the ${__ThreadNum} function 
> > and use some sort of BufferedFileReader class.  The File Reader should 
> > read to line == ${__ThreadNum} extract those values from that line and 
> > do a vars.put(userIdVariable,extractedString);
> > 
> > For files2.csv you just need to set the Sharing Mode property to 'Current Thread'.  That means that every thread iterates through the
> > entire 500 line file and uses all values.    
> > 
> > On Sun, 2014-06-29 at 17:19 +0530, Kajari Ghosh Dastidar wrote:
> > > The following is the scenario I want to run in JMeter: I have one 
> > > CSV file
> > > (file1.csv) containing 100 userIds and passwords. I have created a 
> > > Thread Group containing 100 users. I want each user to read one row 
> > > of userId and password from file1.csv. For this I have added a CSV File Config element.
> > > Now, I want each of these users to read another CSV file (file2.csv) 
> > > containing 500 rows. Each row contains parameters for a HTTP request.
> > > 
> > > So, I want each User to read one set userId, password from one row 
> > > of file1.csv and with that one set the User with fire HTTP request 
> > > 500 times, each time reading each row of file2.csv.
> > > 
> > > Can you please tell me how to design this in JMeter?
> > > 
> > > Thanks!
> > > Kajari
> > 
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> > For additional commands, e-mail: user-help@jmeter.apache.org
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> > For additional commands, e-mail: user-help@jmeter.apache.org
> > 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
> 



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