Hi all,
I'm new to JMeter, and also very new to Beanshell. I have to test a web 
application that presents auctions where some users can place bids (something 
like ebay). I'd like to save the value of the bids that each user placed. I 
wanted to do this in this way:
1. My test plan  tree looks like this (I simplified it a lot no to stir the 
view too much):
        Test Plan (it has one User Defindef Variable: name:bidValue   
value:1000)
          - Thread Group (Number of threads: 20,   Ramp-up period: 1000,   Loop 
count: 3)
            - HTTP Request ( many parameters, in witch one is named BID, and 
the value is ${bidValue}
            - BeanShell PostProcessor

I want to place a Beanshell script in the BeanShell PostProcessor element, 
which will decrement bidValue with a value of 5. So in sum, I want to do 
something like this:
BID value for user 1 (JMeter thread 1) in 1st loop - is 1000
BID value for user 2 (JMeter thread 2) in 1st loop - is 995
BID value for user 3 (JMeter thread 3) in 1st loop - is 990
BID value for user 20 (JMeter thread 20) in 1st loop - is 905

BID value for user 1 (JMeter thread 1) in 2nd loop - is 900
BID value for user 2 (JMeter thread 2) in 2nd loop - is 895
BID value for user 3 (JMeter thread 3) in 2nd loop - is 890
BID value for user 20 (JMeter thread 20) in 2nd loop - is 805

End so on. Here are my questions (all of them are related to writing script in 
the BeanShell PostProcessor element):
1. Can somebody explain how should I do this (what script should I)?
2. When should I fill Parameters field?
3. Do I have to import any packages in the script?
4. Am I allowed only to use those variables mentioned in JMeter documentation 
(log, ctx, vars, prev, data)?
5. What is SampleResult and how can I use this?

I know that there are a lot of questions, and some of them (if not every one ;) 
) may seem a bit funny, but answers for that questions will help me to 
understand usage of Beanshell in JMeter. Please help ;)


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

Reply via email to