Yesterday, I started to write my first test cases with JMeter. Everything worked fine, but my test plan is growing and becomes messy. My problem is that I have a complicated login process with multiple HTTP calls which I need to do before each of my tests. The best way to re-use this login functionality I found so far is this:
I have a thread group (called Do the SAML Login) which is disabled
. It contains two controllers which encapsulate the login and logout. Under that I have multiple thread groups for the actual tests (the screenshot only shows the first one). Each thread group starts and ends with an Once Only Controller
to do the login and logout respectively. Between them are my actual test calls.
My problem is the following: I can execute my tests in a loop and all calls between my Once Only Controllers
are executed multiple times while the login and logout is executed only once (cool!). But when I run with multiple threads, the login/logout is also done multiple times in threads.
How can I prevent this? I think I'm looking for some setup-up and tear-down method for my thread groups, but I don't know how to do it with JMeter.