J. Doem
J. Doem

Reputation: 649

Replicate browser and user behavior with JMeter

I am new on JMeter and would like to get insight on how to replicate browser and user behavior in JMeter. What is the best practice when using JMeter to test web application (mainly for httpd, php, angular etc)

i.e from some reading documentation I should use timer to delay each sampler for more realistic use case

after reading JMeter documentation, I still have some confusion about:

HTTP Request configuration:
- should we use Java instead of HTTPClient4?
- should we enable embedded resources from HTML files?

Cookie Manager:
- should we keep or clear cookies on each iteration

Cache Manager:
- should we clear cache on each iteration or keep it? - should we use cache-control header? - what is the best value for max number elements in cache?

Where i should put cache manager, cookies manager?
Under test plan or under thread group if i have more than 1 thread group?

How to configure keepalive in JMeter sampler or header manager?

My use cases is to replicate 10 concurrent unique user accessing a web application

Upvotes: 0

Views: 574

Answers (1)

Dmitri T
Dmitri T

Reputation: 168092

HTTP Request configuration:

Cookie Manager:

  • should we keep or clear cookies on each iteration Depending on your scenario, for example if it starts from login and ends with logout - it makes sense to clear the cookies to represent "clean" session

Cache Manager:

  • should we clear cache on each iteration or keep it? Depending on your scenario, like Cookie Manager
  • should we use cache-control header? Depending on how caching is implemented in your application under test
  • what is the best value for max number elements in cache? It needs to be sufficient to keep all cacheable content in your application. You can clear i.e. Chrome browser cache, execute your test scenario manually, open chrome://net-internals/#httpCache URL and see how many Entries do you have. Amend this setting to be equal or a little bit more

Where i should put cache manager, cookies manager? Under test plan or under thread group if i have more than 1 thread group? These "managers" obey JMeter Scoping Rules, if you put them under Test Plan - they will be applied to all Thread Groups, if you put them under Thread Groups - they will be applied to current Thread Group only

How to configure keepalive in JMeter sampler or header manager? - If you tick Use KeepAlive under HTTP Request sampler - it will AUTOMATICALLY add Connection: keep-alive header. If you untick it - JMeter will send Connection: close header. Don't use HTTP Header Manager for amending Connection header value

Upvotes: 2

Related Questions