When running a protocol based load test with JMeter, it is always a challenge to make sure the server responses are correct.
The default validation is only done on HTTP response codes based on their value:
OK < 400 <= KO
And since 4XX and 5XX HTTP response codes are error messages it makes sense.
But it's easy to understand why this is not enough.
You want to simulate a realistic load test where every user is having a unique user session. You application may only accept one user login per account at a time. You want each concurrent user to pick a different login password.
It's way more realistic to simulate concurrent users using unique logins and passwords because it's closer to the real world load. It's a good practice to avoid using a single user login and password for all concurrent users. Typically, web servers create web sessions per account. Using a single account for multiple users can mess up things on server side pretty quickly.
JMeter provides a facility to manage login and password: CSV Dataset Config. By defining a CSV file containing all the login and password couples, JMeter can pick a line from the file on each user iteration and assign them into variables.
Server Name Indication (SNI) is an extension to the TLS computer networking protocol by which a client indicates which hostname it is attempting to connect to at the start of the handshaking process.
SNI extension may not work with legacy web-servers who doesn't support it. Fortunately, SNI extension can be disabled in JMeter. JMeter is a Java program. Java has enabled SNI support in Java 7. The issue is typically displayed in JMeter as an SSLHandshakeException, with message like handshake_failure or handshake alert: unrecognized_name.
JMeter uses HTTPClient to perform Http Requests. HttpClient uses the Java JDK SSL support mechanism. Therefore, disabling SNI support in the Java Virtual Machine will disable SNI in HttpClient.
JMeter's While controller is best suited for advanced scripts which simulate realistic user behaviors. It allows to define a behavior which occurs on a certain condition. Designing realistic behaving users involves designing users whose behavior depends on the server responses, and act accordingly.
This post explores in details various JMeter While usages and explains them thoroughly.
This blog post aims to be a collection of sample JSR223, Beanshell and other useful reusable scripts. Use them freely in your JMeter projects to leverage the power of JMeter! Reuse them in JSR223 samplers directly as is, or modify them to fit your needs.
Many other example JSR223 samples can be found in our documentation.