Hi everyone, *DESCRIPTION OF MY SITUATION:* (1) The application I am testing is session-sensitive; I can not log in the second time using the same user as the first time without expiring the first time's session. (2) I want to simulate a workload of 500 users but do not want to create 500 actual test login accounts. (3) I am currently using the "CSV Data Set Config" for obtaining login account for each thread. (4) I am also using the "Regular Expression Extractor" to extract the jsessionid from the URL for subsequent request. *QUESTION:* ** (1) How can I set up my test plan to login only once under a ThreadGroup, and share the session with all threads? I have attempted to use the "Once Only Controller" to include the login request, but results shows that JMeter sends it for every thread. In other words, the scope of "Once Only Controller" seems to be within the Thread, rather than the ThreadGroup. Or perhaps, I am doing something wrong. (2) If possible, can you provide a high level skeleton for the test plan? For example: ThreadGroup -- Once Only Controller ----Login Requests ... ... etc. Thank you, Nguyen mr.nguyendao@gmail.com
On 20/05/2009, Deepak Shetty <sh...@gmail.com> wrote: > Hi > you seem to have conflicting requirements. What you are simulating wont be > anything close to what the browser actually does (I believe IE doesn't send > more than 2 requests in parallel to any one domain). you are planning to > have the same session hit the server with multiple threads , which isnt the > workload of 500 users. Lets say each new User Session on the server has a > footprint of 1 MB then your test would only simulate a memory usage of 1Mb > not 500 MB > > > (2) I want to simulate a workload of 500 users but do not want to create > 500 actual test login accounts. > > Unless there is a license issue or something , dont have this restriction. > > In any case the only way I can think of is have two thread groups. Configure > your test plan to run your thread groups serially. Login in the first thread > group , extract session id, use beanshell to set this as a Jmeter Property > (not variable) > In the next thread group write your test for n Threads and use the session > id from the property > > So > Test Plan (Check Run Thread Groups Consecutively) > Thread Group 1 > Login Request > RegEx Extractor for session Id > Bean Shell listener to set session id as property (read the > variable and set it using the props object) Or use the http://jakarta.apache.org/jmeter/usermanual/functions.html#__setProperty function. > Thread Group 2 > Test (Pass session id reading it from property) > ${__property(sessionid)} > > Ive never tested this btw... Should work... > regards > > deepak > > > > On Wed, May 20, 2009 at 8:06 AM, Nguyen Dao <mr...@gmail.com> wrote: > > > Hi everyone, > > > > *DESCRIPTION OF MY SITUATION:* > > > > (1) The application I am testing is session-sensitive; I can not log in the > > second time using the same user as the first time without expiring the > > first > > time's session. > > > > (2) I want to simulate a workload of 500 users but do not want to create > > 500 > > actual test login accounts. > > > > (3) I am currently using the "CSV Data Set Config" for obtaining login > > account for each thread. > > > > (4) I am also using the "Regular Expression Extractor" to extract the > > jsessionid from the URL for subsequent request. > > > > *QUESTION:* > > ** > > (1) How can I set up my test plan to login only once under a ThreadGroup, > > and share the session with all threads? I have attempted to use the "Once > > Only Controller" to include the login request, but results shows that > > JMeter > > sends it for every thread. In other words, the scope of "Once Only > > Controller" seems to be within the Thread, rather than the ThreadGroup. Or > > perhaps, I am doing something wrong. > > > > (2) If possible, can you provide a high level skeleton for the test plan? > > For example: > > ThreadGroup > > -- Once Only Controller > > ----Login Requests > > ... > > ... > > etc. > > > > Thank you, > > Nguyen > > mr.nguyendao@gmail.com > > > --------------------------------------------------------------------- To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
Hi you seem to have conflicting requirements. What you are simulating wont be anything close to what the browser actually does (I believe IE doesn't send more than 2 requests in parallel to any one domain). you are planning to have the same session hit the server with multiple threads , which isnt the workload of 500 users. Lets say each new User Session on the server has a footprint of 1 MB then your test would only simulate a memory usage of 1Mb not 500 MB > (2) I want to simulate a workload of 500 users but do not want to create 500 actual test login accounts. Unless there is a license issue or something , dont have this restriction. In any case the only way I can think of is have two thread groups. Configure your test plan to run your thread groups serially. Login in the first thread group , extract session id, use beanshell to set this as a Jmeter Property (not variable) In the next thread group write your test for n Threads and use the session id from the property So Test Plan (Check Run Thread Groups Consecutively) Thread Group 1 Login Request RegEx Extractor for session Id Bean Shell listener to set session id as property (read the variable and set it using the props object) Thread Group 2 Test (Pass session id reading it from property) ${__property(sessionid)} Ive never tested this btw... regards deepak On Wed, May 20, 2009 at 8:06 AM, Nguyen Dao <mr...@gmail.com> wrote: > Hi everyone, > > *DESCRIPTION OF MY SITUATION:* > > (1) The application I am testing is session-sensitive; I can not log in the > second time using the same user as the first time without expiring the > first > time's session. > > (2) I want to simulate a workload of 500 users but do not want to create > 500 > actual test login accounts. > > (3) I am currently using the "CSV Data Set Config" for obtaining login > account for each thread. > > (4) I am also using the "Regular Expression Extractor" to extract the > jsessionid from the URL for subsequent request. > > *QUESTION:* > ** > (1) How can I set up my test plan to login only once under a ThreadGroup, > and share the session with all threads? I have attempted to use the "Once > Only Controller" to include the login request, but results shows that > JMeter > sends it for every thread. In other words, the scope of "Once Only > Controller" seems to be within the Thread, rather than the ThreadGroup. Or > perhaps, I am doing something wrong. > > (2) If possible, can you provide a high level skeleton for the test plan? > For example: > ThreadGroup > -- Once Only Controller > ----Login Requests > ... > ... > etc. > > Thank you, > Nguyen > mr.nguyendao@gmail.com >
As Deepak wrote, you are not really testing the server under the correct conditions. To test a server properly, you need to simulate both the number of concurrent (active) sessions as well as the typical page request rate. So, first you need to establish what load you want to generate: what is the maximum number of concurrent sessions, what is a typical usage scenario and what is the page request rate. Each concurrent session needs a separate thread. Each thread should include a typical usage scenario including pauses. If you really want to test 500 concurrent sessions, then you will need to use 500 threads. However, if you want to test 500 sessions over the period of an hour, then use as many threads as there will be concurrent sessions, and run multiple loops of each thread, so as one session ends, another will be started. Of course if you just want to see how the server reacts to the request load, regardless of the session load, then you can make do with fewer threads, and you can increase the request rate by reducing the wait time. If the server fails to handle the desired load with only a single session, then you have a problem. If the server handles the load with a single session, then you still need to test with the desired session load. On 20/05/2009, Nguyen Dao <mr...@gmail.com> wrote: > Hi everyone, > > *DESCRIPTION OF MY SITUATION:* > > (1) The application I am testing is session-sensitive; I can not log in the > second time using the same user as the first time without expiring the first > time's session. > > (2) I want to simulate a workload of 500 users but do not want to create 500 > actual test login accounts. > > (3) I am currently using the "CSV Data Set Config" for obtaining login > account for each thread. > > (4) I am also using the "Regular Expression Extractor" to extract the > jsessionid from the URL for subsequent request. > > *QUESTION:* > ** > (1) How can I set up my test plan to login only once under a ThreadGroup, > and share the session with all threads? I have attempted to use the "Once > Only Controller" to include the login request, but results shows that JMeter > sends it for every thread. In other words, the scope of "Once Only > Controller" seems to be within the Thread, rather than the ThreadGroup. Or > perhaps, I am doing something wrong. > > (2) If possible, can you provide a high level skeleton for the test plan? > For example: > ThreadGroup > -- Once Only Controller > ----Login Requests > ... > ... > etc. > > Thank you, > Nguyen > mr.nguyendao@gmail.com > --------------------------------------------------------------------- To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: jmeter-user-help@jakarta.apache.org