with the beanshell, I can create 2 different custom CSV files per iteration.
And I can write an array of values.
this is the code I've written so far:

int number= Integer.parseInt( vars.get("PERSONID_matchNr"));
String anElement;
if (prev.isSuccessful()) {
        BufferedWriter out = new BufferedWriter(new
FileWriter("/tmp/output.csv",true));
        for (int i = 1; i <= number ; i++) {
    anElement = vars.get("PERSONID_"+Integer.toString(i) );
     out.write(anElement);
     out.newLine();
        }
        out.close();
}




On Tue, Nov 9, 2010 at 8:41 AM, Deepak Shetty <[email protected]> wrote:

> hi
> so why doesnt sample_variables work for you?
> What flexibility are you looking for? If you can provide a specific example
> of what you want to do , we can help you with the beanshell script.
>
> regards
> deepak
>
>
> On Tue, Nov 9, 2010 at 5:23 AM, thanh nguyen <[email protected]
> >wrote:
>
> > Hi Deepak,
> >
> > I want to write some data I extract from few web pages. I want to use the
> > simple data writer.
> > the current configuration is not flexible. Perhaps I need to write some
> > Beanshell postprocessor script. Besides the official beanshell reference
> > found on their website and some tiny examples found in the Jmeter
> website,
> > is there any Jmeter example elsewhere?
> >
> > thank you
> >
> > Thanh
> >
> > On Mon, Nov 8, 2010 at 10:57 PM, Deepak Shetty <[email protected]>
> wrote:
> >
> > > what are you trying to do?
> > > I usually change this from ANT  while invoking the test
> > > <target name="runJMeter" depends="init">
> > > ....
> > >    <jmeter
> > >        jmeterhome=".."
> > >        testplan="${run.test.plan}"
> > >
> > >
> > >
> >
> resultlog="${report.dir}/${run.test.report}-${run.env}-${DSTAMP}${TSTAMP}.jtl">
> > >        <property name="jmeter.save.saveservice.output_format"
> > value="xml"/>
> > >        <property name="run.server" value="${run.server}" />
> > >        <property name="run.server.port" value="${run.server.port}" />
> > >        <property name="sample_variables" value="${sample_variables}" />
> > >    </jmeter>
> > > ..........
> > > </target>
> > >
> > > <target name="runEvolutionSmokeTest" depends="init">
> > > ...........
> > >  <antcall target="runJMeter">
> > >    <param name="run.test.plan" value="Evolution.jmx"/>
> > >    <param name="run.test.report" value="EvolutionSmokeTest"/>
> > >    <param name="sample_variables" value="var1,var2"/>
> > >    <param name="xsl.file" value="jmeter-results-report_21.xsl" />
> > >  </antcall>
> > > ............
> > > </target>
> > >
> > > regards
> > > deepak
> > >
> > >
> > > On Mon, Nov 8, 2010 at 12:28 PM, thanh nguyen <
> [email protected]
> > > >wrote:
> > >
> > > > Hi all,
> > > >
> > > > The sample_variables is currently set in the jmeter.properties file.
> Is
> > > > there a way to set it in the testplan?
> > > >
> > > > Thank you
> > > > Thanh
> > > >
> > >
> >
>

Reply via email to