Following is the set of JMeter Interview Questions #7.
Q. 31 How sessions and cookies are managed in JMeter
Ans: Sessions and cookies are managed in JMeter by using config elements such as HTTP Cookie Manager which provides an option to save the cookie. There is also an option to clear the cookies in every iteration and also allows to add user-defined cookies.
HTTP Cache manager helps to cache the images and .css file. It can also be cleared after each iteration as per the requirement in the load tests and also limits the number of elements which can be stored in the cache.
Q. 32 Why HTTP Cookie and Cache Manager are used in JMeter?
Ans: HTTP Cookie and Cache manager help to simulate the browser behaviour and create a real-world scenario in the test environment.
Q. 33 How database connection can be set-up in JMeter?
Ans: Database connection can be set-up by JDBC default request (Config Element) or JDBC request (Sampler).
Q. 34 What is BeanShell scripting?
Ans: BeanShell scripting is used to write the custom code in the JMeter script. Most of the tasks are covered by available JMeter elements, apart from this if there are any complex scenario then BeanShell scripting is used. It is a lightweight Java scripting to perform some additional task.
Q. 35 What are the BeanShell elements available in the JMeter?
Ans: Following are the BeanShell elements:
- BeanShell PreProcessor
- BeanShell PostProcessor
- BeanShell Timer
- BeanShell Assertion
- BeanShell Listener
- BeanShell Sampler
You may be interested: