On 26/09/2007, Simon Brown <[EMAIL PROTECTED]> wrote:
> Hi Sebb,
>
> So basically what you're saying is that the while loop in JMeter doesn't
> work like a conventional while loop in for e.g. Java?

No, I'm not.

The loop would not work in Java either - once you have reached
url=<EOF>, it stays there.

What is different about JMeter is that it is difficult/impossible to
reset the file reader.

> I'm doing a regression test on a suite of urls with different
> user-agents.  I want to send a request to each url for all the
> user-agents.  Both the url and user-agent lists are stored in csv files.
>
> Any suggestions?

Yes, see my earlier posting as to how you can get round the JMeter
file reset limitation.

> Thanks,
>
> Simon
>
> -----Original Message-----
> From: sebb [mailto:[EMAIL PROTECTED]
> Sent: 26 September 2007 15:50
> To: JMeter Users List
> Subject: Re: iterating through 2 data sets
>
> Still does not work, because the url will remain set to <EOF> once
> reached as there is nothing to change it.
>
> As I said, JMeter cannot reset the file back to the beginning, so you
> need to work round this - see my suggestions.
>
> It might help to know what you are trying to test - perhaps there is a
> better way of coding it.
>
> On 26/09/2007, Simon Brown <[EMAIL PROTECTED]> wrote:
> > Hi Sebb,
> >
> > Many thanks for your response.  Sorry - I made a mistake in the
> > pseudocode - for every url in file 2 there should be a request made
> for
> > every header in file 1!
> >
> > It should be:
> >
> > String header, url;
> > header = readFromCSV(file1);
> > url = readFromCSV(file2);
> >
> > while (header != "<EOF>")
> > {
> >      while (url != "<EOF>")
> >      {
> >                HTTPRequest(header, url);
> >                url = readFromCSV(file2);
> >      }
> >        header = readFromCSV(file1);
> > }
> >
> > Regards,
> >
> > Simon
> >
> >
> >
> > -----Original Message-----
> > From: sebb [mailto:[EMAIL PROTECTED]
> > Sent: 26 September 2007 14:54
> > To: JMeter Users List
> > Subject: Re: iterating through 2 data sets
> >
> > On 26/09/2007, Simon Brown <[EMAIL PROTECTED]> wrote:
> > > Hi,
> > >
> > >
> > >
> > > I'm having problems with a while loop within a while loop, doing the
> > > following (written in pseudocode):
> > >
> > >
> > >
> > > String header, url;
> > >
> > > header = readFromCSV(file1);
> > >
> > > url = readFromCSV(file2);
> > >
> > >
> > >
> > > while (header != "<EOF>")
> > >
> > > {
> > >
> > >            while (url != "<EOF>")
> > >
> > >            {
> > >
> > >                        HTTPRequest(header, url);
> > >
> > >            }
> > >
> > > }
> > >
> > >
> > >
> > > Is there any way to do something equivalent in JMeter?  I currently
> > > cannot get it to loop through all the urls and all the headers.  Am
> I
> > > missing something?
> >
> > It looks as though the header and url are only read once.
> >
> > Also presumably the url loop needs to be reset for each header?
> >
> > It's not possible to "reset" a file reader in JMeter, though you can
> > loop through a file repeatedly. If you know how many entries there are
> > (or what the last one is) you can construct a loop around that.
> >
> > BTW, the Java Request sampler is good for testing - it does not need a
> > server, and you can include any variable names you like in the label
> > or response data etc.
> >
> > >
> > > Thanks,
> > >
> > >
> > >
> > > Simon
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to