You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by sjunejo <sj...@temenos.com> on 2009/08/14 12:51:35 UTC
How To Use ThreadGroup Name As A Variable In Test
Hi,
I have developed a test script which has 10 Thread Group each representing
10 users of my system. I named each of my ThreadGroup same as the UserName
exist in my Application as follows;
DEMOTEST1
DEMOTEST2
DEMOTEST3
DEMOTEST4
.
.
DEMOTEST10
Note: Each above name is user in my application.
Is there anyway I can use these Names with in the same threadgroup or Assign
it to a Local variable. I just want it to save some time otherwise I have to
change 20 times in each thread for each user???
Thanks in advance
Regards,
--
View this message in context: http://www.nabble.com/How-To-Use-ThreadGroup-Name-As-A-Variable-In-Test-tp24969782p24969782.html
Sent from the JMeter - User mailing list archive 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: How To Use ThreadGroup Name As A Variable In Test
Posted by sjunejo <sj...@temenos.com>.
Hi Andrey,
First of all thanks for your reply and appriciate your advice.
Note: I forget to mention that this topic is all about improving my
existing jMeter script or about learning a technique so I can create my
future scripts more effeciently rather than editing user1 to user2 and user2
to user3 in each thread group :-).
My scenario is like, I have to replay seven servlets each in 10 thread
(Total 70). What I did was, I developed [DEMOTEST1] threadgroup
successfully. Now other nine will be just copy paste of it but with
different TransactionID and some more editing. All of servlet contain user
name atleast twice and as I was already giving each threadgroup a same name
as my user to login my application I thought of using the ThreadGroup name
(SOMEHOW), So when I copy and paste DEMOTEST1 threadgroup and change name
from DEMOTEST1 to DEMOTEST2 I dont have to change anywhere in my seven
servlet. Infact thats what I am concern about.
To solve my pronblem I just declare a variable in threadgroup called
USER=DEMOTEST and then in each
threadgroup just called it as ${USER}1, ${USER}2......and so on at each
instance. As I have to edit all my servlets one by one anyway why should I
decalre 10 variable rather than just one and append the number in front.
On the other hand If I choose to implement your suggestion its more or less
same. I still have to edit :-).
If someone find a way to fetch ThreadGroup name please add your solution
here.
Thanks & Regards :)
Andrey Simonov wrote:
>
> Hi sjunejo,
>
> You are doing this other way round, I think.
>
> My suggestion is to create a list of variables either in the Test Plan or
> User Defined Variables elements and use these variables as names for
> Thread Groups.
>
> So Thread Groups will be called like ${Test1}, ${Test2}, etc.
>
> Actually I haven't tested this :) Hope this helps.
>
>
> sjunejo wrote:
>>
>> Hi,
>>
>> I have developed a test script which has 10 Thread Group each
>> representing 10 users of my system. I named each of my ThreadGroup same
>> as the UserName exist in my Application as follows;
>>
>> DEMOTEST1
>> DEMOTEST2
>> DEMOTEST3
>> DEMOTEST4
>> .
>> .
>> DEMOTEST10
>>
>> Note: Each above name is user in my application.
>>
>> Is there anyway I can use these Names with in the same threadgroup or
>> Assign it to a Local variable. I just want it to save some time otherwise
>> I have to change 20 times in each thread for each user???
>>
>> Thanks in advance
>>
>> Regards,
>>
>
>
--
View this message in context: http://www.nabble.com/How-To-Use-ThreadGroup-Name-As-A-Variable-In-Test-tp24969782p25003233.html
Sent from the JMeter - User mailing list archive 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: How To Use ThreadGroup Name As A Variable In Test
Posted by Andrey Simonov <au...@bk.ru>.
Hi sjunejo,
You are doing this other way round, I think.
My suggestion is to create a list of variables either in the Test Plan or
User Defined Variables elements and use these variables as names for Thread
Groups.
So Thread Groups will be called like ${Test1}, ${Test2}, etc.
Actually I haven't tested this :) Hope this helps.
sjunejo wrote:
>
> Hi,
>
> I have developed a test script which has 10 Thread Group each representing
> 10 users of my system. I named each of my ThreadGroup same as the UserName
> exist in my Application as follows;
>
> DEMOTEST1
> DEMOTEST2
> DEMOTEST3
> DEMOTEST4
> .
> .
> DEMOTEST10
>
> Note: Each above name is user in my application.
>
> Is there anyway I can use these Names with in the same threadgroup or
> Assign it to a Local variable. I just want it to save some time otherwise
> I have to change 20 times in each thread for each user???
>
> Thanks in advance
>
> Regards,
>
--
View this message in context: http://www.nabble.com/How-To-Use-ThreadGroup-Name-As-A-Variable-In-Test-tp24969782p25002686.html
Sent from the JMeter - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org