You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Yanroy <rm...@wpi.edu> on 2006/07/26 22:55:01 UTC

complex page navigation problems

The website I'm working on presents a series of questions to the user that
can be multiple-choice (radio buttons) or open-ended (text field).  I'm
trying to create a JMeter test that will navigate through an entire set of
these questions.  Each question has associated with it a number of helpful
messages if you get the answer incorrect, some of which are actually
questions in and of themselves designed to break the question down into
simpler sub-questions to assist the user in getting it correct.  For a
first-draft version of this test, I'd just like to be able to iterate
through all the questions and ignore the hints, which requires that I get
the question right on the first try - it's easy enough for me to get a CSV
file or the like with the problem ID's and correct answers to read in.  My
problem/question is this: how do I load the values in a useful way?  I'm
already using the CSV data set config element to load my usernames and
passwords (so each thread has a unique user), but I need some more complex
behavior than this.  Is there any way to treat a CSV file as a sort of map,
such that I can use a regex to extract the problem ID from the webpage and
use that as a key to look up the correct answer?  Failing that, is there any
way for me to get some slightly different behavior out of the CSV config
element such that all threads will use the same data and each will have its
own independent "pointer" to its current row, and this pointer can be
incremented by a loop controller (or some other element inside a loop
controller)?  The goal with this second approach is to be able to have all
the threads have all the answers and iterate through the answer set every
time the loop controller moves on to a new problem.

I'd greatly appreciate any help with this problem.  If someone has a
better/possible way to accomplish my goal using a technique different than
the two I outlined above, I'm open to suggestions on that front as well. 
Also, if this functionality is simply impossible with the current program,
would it be terribly difficult for me to add it?  Thank you all very much.

PS - According to the JMeter site, #jmeter on irc.us.freenode.net is the
official channel... it seems to be totally deserted.  What's up with that?
-- 
View this message in context: http://www.nabble.com/complex-page-navigation-problems-tf2006048.html#a5510819
Sent from the JMeter - User forum at Nabble.com.


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


Re: complex page navigation problems

Posted by sebb <se...@gmail.com>.
On 31/07/06, Yanroy <rm...@wpi.edu> wrote:
>
>
> sebb-2 wrote:
> >
> > Are these randomly generated, or does the same URL always generate the
> > same questions?
> >
>
> They're not random, but they aren't generated by a URL.  There is state
> information stored in a database that has nothing to do with the user and is
> inaccessible.
>
>
> sebb-2 wrote:
> >
> > If you know - or can define - the order in which the questions will be
> > presented, then just order the items in the file.
> >
>
> My impression of the way the CSV config element works is that it loads one
> line per thread.  Is this incorrect?

No, this is correct.

> I've been assuming this because of the
> way it works for storing login information (one line per user, each thread
> gets a seperate user).

Yes.

> How can I control how it reads the file so I can get
> the next line when it's time to go to the next problem?

Not possible without amending the code. The next line will be read and
parsed when the next thread needs it - there is no guarantee that the
threads are processed in order.

>
> sebb-2 wrote:
> >
> > If you have some Java experience, it should not be too difficult to
> > add the per-thread functionality to CSV Data set.
> >
> > Or you could perhaps use the BeanShell pre-processor or function to
> > implement the mapping between question and answer - perhaps create the
> > mapping using the startup file.
> >
> > Also, just had an idea: you might be able to use a property file to
> > map between question and answer, and then use the __P() function to
> > read the value.
> > This depends on whether the questions and answers can be successfully
> > stored as Java properties. JMeter supports additional property files,
> > so the info can be held separately.
> >
>
> Well, I've heard bad things about BeanShell, so I've avoided trying to learn

What bad things?

> it.  Maybe I'll give it a try.  I have significant java experience (I've

In which case BeanShell should be easy for you...

> helped develop the app I'm testing, among other things), so if I can't solve
> this some other way, maybe I'll dive into the jmeter source.  Would anyone
> else be interested in an upgraded CSV config element? ;)  Thanks for your
> help so far.
> --
> View this message in context: http://www.nabble.com/complex-page-navigation-problems-tf2006048.html#a5579663
> Sent from the JMeter - User forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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: complex page navigation problems

Posted by Yanroy <rm...@wpi.edu>.

sebb-2 wrote:
> 
> Are these randomly generated, or does the same URL always generate the
> same questions?
> 

They're not random, but they aren't generated by a URL.  There is state
information stored in a database that has nothing to do with the user and is
inaccessible.


sebb-2 wrote:
> 
> If you know - or can define - the order in which the questions will be
> presented, then just order the items in the file.
> 

My impression of the way the CSV config element works is that it loads one
line per thread.  Is this incorrect?  I've been assuming this because of the
way it works for storing login information (one line per user, each thread
gets a seperate user).  How can I control how it reads the file so I can get
the next line when it's time to go to the next problem?


sebb-2 wrote:
> 
> If you have some Java experience, it should not be too difficult to
> add the per-thread functionality to CSV Data set.
> 
> Or you could perhaps use the BeanShell pre-processor or function to
> implement the mapping between question and answer - perhaps create the
> mapping using the startup file.
> 
> Also, just had an idea: you might be able to use a property file to
> map between question and answer, and then use the __P() function to
> read the value.
> This depends on whether the questions and answers can be successfully
> stored as Java properties. JMeter supports additional property files,
> so the info can be held separately.
> 

Well, I've heard bad things about BeanShell, so I've avoided trying to learn
it.  Maybe I'll give it a try.  I have significant java experience (I've
helped develop the app I'm testing, among other things), so if I can't solve
this some other way, maybe I'll dive into the jmeter source.  Would anyone
else be interested in an upgraded CSV config element? ;)  Thanks for your
help so far.
-- 
View this message in context: http://www.nabble.com/complex-page-navigation-problems-tf2006048.html#a5579663
Sent from the JMeter - User forum at Nabble.com.


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


Re: complex page navigation problems

Posted by sebb <se...@gmail.com>.
On 26/07/06, Yanroy <rm...@wpi.edu> wrote:
>
> The website I'm working on presents a series of questions to the user that
> can be multiple-choice (radio buttons) or open-ended (text field).  I'm

Are these randomly generated, or does the same URL always generate the
same questions?

> trying to create a JMeter test that will navigate through an entire set of
> these questions.  Each question has associated with it a number of helpful
> messages if you get the answer incorrect, some of which are actually
> questions in and of themselves designed to break the question down into
> simpler sub-questions to assist the user in getting it correct.  For a
> first-draft version of this test, I'd just like to be able to iterate
> through all the questions and ignore the hints, which requires that I get
> the question right on the first try - it's easy enough for me to get a CSV
> file or the like with the problem ID's and correct answers to read in.  My
> problem/question is this: how do I load the values in a useful way?  I'm

If you know - or can define - the order in which the questions will be
presented, then just order the items in the file.

> already using the CSV data set config element to load my usernames and
> passwords (so each thread has a unique user), but I need some more complex
> behavior than this.  Is there any way to treat a CSV file as a sort of map,
> such that I can use a regex to extract the problem ID from the webpage and
> use that as a key to look up the correct answer?

No - the CSV data file is read a line at a time, and split into the variables.

> Failing that, is there any
> way for me to get some slightly different behavior out of the CSV config
> element such that all threads will use the same data and each will have its
> own independent "pointer" to its current row, and this pointer can be
> incremented by a loop controller (or some other element inside a loop
> controller)?

Not at present.  You could try using multiple copies of the CSV data
set, each with a different file, and use the thread number function
get the current thread number. Try it with a simple test with two
threads.

Otherwise, it would mean changing the CSV Data set code to add a new option.

> The goal with this second approach is to be able to have all
> the threads have all the answers and iterate through the answer set every
> time the loop controller moves on to a new problem.
>
> I'd greatly appreciate any help with this problem.  If someone has a
> better/possible way to accomplish my goal using a technique different than
> the two I outlined above, I'm open to suggestions on that front as well.
> Also, if this functionality is simply impossible with the current program,
> would it be terribly difficult for me to add it?  Thank you all very much.

If you have some Java experience, it should not be too difficult to
add the per-thread functionality to CSV Data set.

Or you could perhaps use the BeanShell pre-processor or function to
implement the mapping between question and answer - perhaps create the
mapping using the startup file.

Also, just had an idea: you might be able to use a property file to
map between question and answer, and then use the __P() function to
read the value.
This depends on whether the questions and answers can be successfully
stored as Java properties. JMeter supports additional property files,
so the info can be held separately.


> PS - According to the JMeter site, #jmeter on irc.us.freenode.net is the
> official channel... it seems to be totally deserted.  What's up with that?
> --
> View this message in context: http://www.nabble.com/complex-page-navigation-problems-tf2006048.html#a5510819
> Sent from the JMeter - User forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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