Day2 Session
Recap of Day1 1. Purpose of performance tool 3. Simple recording of a script in Jmeter and replaying it back 5. Applying load on an application
Agenda • Elements in Jmeter • Logic controllers • Config element • Preprocessors • Samplers • Assertions • Postprocessors • Parameterization • What is parameterization • Methods of Parameterization • Using User Parameters • Using HTTP User Parameter Modifier • Using HTML Parameter Masking • Correlation • What is Correlation • Steps for Correlation in Jmeter • Assignment
Elements in Jmeter Logic controllers Controllers are used to organize the samplers as desired to execute them.
Types of controllers: •Simple Controllers •Include controller •Interleave controller •Module controller
Logic controllers Types of controllers continued … •
Runtime Controller
•
Random Controller
•
Random Order Controller
•
Once only Controller
•
Loop Controller
•
Switch controller
•
Transaction Controller
Config Element • CSV data set configuration: CSV Data Set Config is used to read lines from a file, and split them into variables. • User defined variables : The User Defined Variables lets you define variables for use in other test elements, just as in the Test Plan.. • HTTP Request Defaults :This element lets you set default values that your HTTP Request controllers use. • HTTP Cookie Manager: It stores and sends cookies just like a web browser.
Preprocessors Preprocessors are used to modify the Samplers in their scope. Types Of Preprocessors: • Counter: Counter is used to create a variable to refer further in the samplers. It will be incremented each time of the new iteration. • URL Rewriting Modifier:“Url Rewriting Modifier” element is used to modify the request the server by changing the URL. • User Parameter Modifier: This is used to give a set of data for an argument (parameterization).
Samplers Samplers perform the actual work of Jmeter by sending request to the server. Each sampler (except Test Action) generates one or more sample results. Different samplers in JMeter are: • Java Request • HTTP Request • WebService (SOAP) Request • BeanShell Sampler • JDBC Request
Assertions Assertions are used to check whether the expected pattern is present in the output is not. The outputs of all the assertions can observed in the Assertion Results listener. Only failed responses will be displayed in the Assertions pane.
Types Of Assertions: •
Response Assertion
•
Duration Assertion
•
HTML Assertion
•
Size Assertion
•
XML Assertion
Postprocessors Post-Processors are applied after samplers. Note that they are applied to all the samplers in the same scope, so to ensure that a post-processor is applied only to a particular sampler, add it as a child of the sampler.
Types Of Post Processors: • XPATH Xtractor: Xpath extractor is used to extract value from the structured response. • Result Status Action Handler: This processor is used to take the action specified when a particular sampler error has occurred.
Postprocessors Types Of Post Processors continued…
• Save responses to a file: This option is used to store the response data of the test plan in a file. If “Save Failed Responses only” is checked then the output file contains the data of Failed Responses only. • Generate Summary Results: This test element can be placed anywhere in the test plan. It generates the summary of the test run so far and the output generated can be observed in the command prompt.