You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by St...@quinn-direct.com on 2005/12/01 18:38:22 UTC

CSV files and ForEach Controller

Hi all,

I'm having a little problem doing a basic proof of concept on reading in a
CSV file that comprises one column of policy numbers and does a HTTP
Request Sampler based on this :

1234567
2365456
1653224

I want a ForEach controller to take each of these and to exectute a simple
HTTP Request sampler, appending each item to a requested URL, say :
www.google.com?${item}

In the CSV Data Set Config, I have my file name which is picked up
successfully, I define a variable name "policy" with no delimiter as it's
only 1 column.

In my ForEach controller, I define the input variable prefix to be "policy"
and the output variable name as "policyRef".

I then have a HTTP Request Sampler that defines the path as
"/index.com?${policyRef}".

Looking thru the debug log, I see it reads the file, but has a problem with
the "policyRefX" where X is 1, looking for the first item, snippets of log
are :

2005/12/01 16:24:05 DEBUG - jmeter.testbeans.TestBeanHelper: Setting
filename=csvtest.txt
2005/12/01 16:24:05 DEBUG - jmeter.testbeans.TestBeanHelper: Setting
variableNames=policy
2005/12/01 16:24:05 DEBUG - jmeter.testbeans.TestBeanHelper: Setting
delimiter=
2005/12/01 16:24:05 INFO  - jmeter.threads.JMeterThread: Thread Thread
Group 1-1 started
2005/12/01 16:24:05 DEBUG - jmeter.control.GenericController: Calling next
on: org.apache.jmeter.control.LoopController
2005/12/01 16:24:05 DEBUG - jmeter.control.ForeachController: No entries
found - null first entry: policyRef1

I've gone thru doccos  and tried lots of tests, but I can't work out how to
get the interaction right between the CSV Data Set Config output variable
and the ForEach controller, it's probably something to do with the "1"
appended to the ForeachController and a misconfiguration in the way I'm
trying to reference the variable name "policy" set up by the CSV Data Set.

Any suggestions would be greatly appreciated.

Thanks,
Pete.





***********************************************************************************
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager.
This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses.
***********************************************************************************
For any information on the Quinn Group of Companies please visit :-

http://www.quinn-group.com


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


Re: CSV files and ForEach Controller

Posted by sebb <se...@gmail.com>.
On 01/12/05, StokesP@quinn-direct.com <St...@quinn-direct.com> wrote:
>
> Hi all,
>
> I'm having a little problem doing a basic proof of concept on reading in a
> CSV file that comprises one column of policy numbers and does a HTTP
> Request Sampler based on this :
>
> 1234567
> 2365456
> 1653224
>
> I want a ForEach controller to take each of these and to exectute a simple
> HTTP Request sampler, appending each item to a requested URL, say :
> www.google.com?${item}
>
> In the CSV Data Set Config, I have my file name which is picked up
> successfully, I define a variable name "policy" with no delimiter as it's
> only 1 column.
>
> In my ForEach controller, I define the input variable prefix to be "policy"
> and the output variable name as "policyRef".

> I then have a HTTP Request Sampler that defines the path as
> "/index.com?${policyRef}".
>
> Looking thru the debug log, I see it reads the file, but has a problem with
> the "policyRefX" where X is 1, looking for the first item, snippets of log
> are :
>
> 2005/12/01 16:24:05 DEBUG - jmeter.testbeans.TestBeanHelper: Setting
> filename=csvtest.txt
> 2005/12/01 16:24:05 DEBUG - jmeter.testbeans.TestBeanHelper: Setting
> variableNames=policy
> 2005/12/01 16:24:05 DEBUG - jmeter.testbeans.TestBeanHelper: Setting
> delimiter=
> 2005/12/01 16:24:05 INFO  - jmeter.threads.JMeterThread: Thread Thread
> Group 1-1 started
> 2005/12/01 16:24:05 DEBUG - jmeter.control.GenericController: Calling next
> on: org.apache.jmeter.control.LoopController
> 2005/12/01 16:24:05 DEBUG - jmeter.control.ForeachController: No entries
> found - null first entry: policyRef1
>
> I've gone thru doccos  and tried lots of tests, but I can't work out how to
> get the interaction right between the CSV Data Set Config output variable
> and the ForEach controller, it's probably something to do with the "1"
> appended to the ForeachController and a misconfiguration in the way I'm
> trying to reference the variable name "policy" set up by the CSV Data Set.
>
> Any suggestions would be greatly appreciated.
>

The ForEach Controller is intended for use with the RE Post-Processor,
and requires a SET of variables.

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

In your case it will be looking for variables called:

policy_n or policyn (if the _ is omitted).

==

What are you actually trying to do?

S.

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