jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Ide <flyingrhenqu...@gmail.com>
Subject Re: Generate requests at specified time
Date Sat, 24 Sep 2011 20:10:33 GMT
I don't know if it's pertinent to the conversation, but this somewhat
reminds me of a test I had to write a while back, where a web page would
allow only 1 administrative login at a time. But it wouldn't tell you if you
logged in a second time; by design if you logged in again the first login
session would be ended, and any action the first session took at that point
would direct you back to the login page.

I ended up writing a couple of jmeter addons to do thread synchronization
for this test. They're at
https://github.com/FlyingRhenquest/JmeterThreadSync and
https://github.com/FlyingRhenquest/JmeterThreadGlobal.

My test was set up with 3 thread groups and 4 threads.

I created 3 JmeterThreadSync config elements, named "setup", "login" and
"validation". Setup and Validation were configured to unblock after they'd
been hit 3 times. Login was configured to unblock after being hit twice.

My first thread group was for setup and had a "setup" JmeterThreadSync
sampler at the end of it, and was used to make sure my admin account would
work prior to the test starting.

The second thread group created 2 threads, both of which would try to log
into the web page and run a search. They had "setup" samplers at their
start, which would insure that they would block until setup completed its
execution. Right after they logged into the web page, they had "login"
samplers, insuring that both threads would be logged in prior to the test
continuing. They would then attempt to click on a "Search" link, which would
send one of the sessions back to the login page. I searched for the header
the page I retrieved into a JmeterThreadGlobal variable to pass it on to
validation and finally ran into the "valdiation" sampler at the end of the
test, insuring that the validation phase would not execute until both of the
test threads had reached that point.

The final thread had a "validation" JmeterThreadSync sampler at the
beginning, which would not unblock until the test threads executed theirs.
It then read the headers from both test samplers through my
JmeterThreadGlobal config element (It gets these as an array) and verified
that one had reached the search page and one had been sent to the login
page.

If you need that level of complexity, feel free to try my addons to see if
they work for you. They're licensed under the same Apache license Jmeter is,
and the source code and Jmeter 2.4 jars are available on github. Keep in
mind that when you do something like this it makes for an extremely
complicated test that no one else will understand. My test worked great, but
no one else understands it.

-- 
Bruce Ide
FlyingRhenquest@gmail.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message