- thread group (user)
- ramp-up period (defines concurrency behaviour, if 0, means start all users immediately; if 5 users in 5 sec, then interval between each user is 1 sec, normally there's ramp-up, a flat top where all users running, and a ramp-down)
- sampler (request definition, http request is just one type of request, there're others)
- http request defaults (default http request properties)
- http cookie manager (cookie is shared between all http requests of a thread)
- header manager (control things like user agent, application/json)
- timer (add wait before each request)
- synchronising timers (all threads are blocked until a specified number of threads is reached)
- throughput shape timer (define expected throughput)
- when a test plan is started, Jmeter kicks off a thread per virtual user
- each thread starts executing samplers (request) in sequential order (or according to the Logic Controllers, if any) as fast as it can
- when no samplers are left to execute and no loops to iterate the thread is being shut down
- timer is to add wait in between the samplers
3. if multiple users concurrent run, it's better to have ramp-up time or using synchronizing timer.
- because when the earliest thread finish, it will try to grab the 1st usrid/passwd and run
- at this time, the previous thread that use this usrid/passwd may not finish yet
4. install plugin
- download plugin manager jar file and put the jar file under lib/ext directory, use it to install other plugins, or brew install jmeter will automatically install plugin manager
- on mac, use 'open $path/jmeter/bin/jmeter' to open jmeter
- check java version when encounter problem with plugin manager
5. generate dashboard from jtl
- ui listener such as view result tree
- headless listener such as simple data writer (non-ui mode, fast less memory, large # of concurrent users)
- both can write to log files like jtl
6. different ramp up (ultimate thread group plugin)
- linear
- step
- spike
7. use certificate
- jmeter -n -t uhl.jmx -l testresults.jtl -D javax.net.ssl.keyStore=nonprod.p12 -D javax.net.ssl.keyStorePassword=password
- from ui, options -> ssl manager
9. vars vs props vs $
- props has global scope, vars is limited to current thread group, $ is limited to current sampler
10. multi-thread
- user login thread, run once, save token and cookie
- user action thread, add cookie to cookie manager
- each login thread and corresponding action thread use its own set of cookie
11. jmeter UI
- cookie manage: store cookie from each response and use in next request
- click logviewer icon can see jmeter logs
- view result tree request tab: raw tab can see the cookie data, http tab can see decoded data
- view result tree response tab: response body if html can render it to webpage to view, response header can see the 'set-cookie', i.e. new cookie that's set to next request
12. cookie manager
- cookies and added from server via response header, e.g. set-cookie: ebproxy=amp1
- cookie follows domain and path matching rule, cookie manager only send cookies that match domain and path of current request
13. jmeter.properties
- CookieManager.allow_variable_cookies=true
- CookieManager.save.cookies=true
reference
1. jmeter 2 min tutorial
2. using jmeter timer
4. top 10 jmeter plugins
5. generate dashboard report from gui
6. rest api testing with jmeter
7. extract data from json response using jmeter
8. how to use JMeter for performance & load testing
9. how to choose number of threads for jmeter plan
10. jmeter-ramp-up-the-ultimate-guide
11. generate timestamp in jmeter
12. how-to-run-jmeter-in-non-gui-mode
13. 3-easy-ways-to-monitor-jmeter-non-gui-test-results
14. how-to-analyze-jmeter-results
15. how-set-your-jmeter-load-test-use-client-side-certificates