Jmeter 1
Jmeter 1
Jmeter 1
Simple Controllers The Simple Logic Controller lets you organize your Samplers and other Logic Controllers. Unlike other Logic Controllers, this controller provides no functionality beyond that of a storage device. Simple controller just executes the pages as we configured. Example Simple controller not allow to execute the news page after the execution of Home page
2. Loop Controller JMeter will loop through them a certain number of times, in addition to the loop value you specified for the Thread Group. For example, if you add one HTTP Request to a Loop Controller with a loop count of two, and configure the Thread Group loop count to three, JMeter will send a total of 2 * 3 = 6 HTTP Requests.
3. Only Once Controller The Once Only Controller will now execute always during the first iteration of any looping parent controller. Thus, if the Once Only Controller is placed under a Loop Controller specified to loop 5 times, then the Once Only Controller will execute only on the first iteration through the Loop Controller (i.e., every 5 times). Note this means the Once Only Controller will still
behave as previously expected if put under a Thread Group (runs only once per test), but now the user has more flexibility in the use of the Once Only Controller For testing that requires a login, consider placing the login request in this controller since each thread only needs to login once to establish a session
Thread Iteration: 5 times but we use only one controller it executes only one time Home Page 4. Interleave Controller JMeter will alternate among each of the other controllers for each loop execution. Two interleave controllers are there: Simple and Useful Useful Interleave controller:
The outer Interleave Controller alternates between the two inner ones. Then, each inner Interleave Controller alternates between each of the HTTP Requests. Each JMeter thread will send the requests in the following order: Home Page, Interleaved, Bug Page, Interleaved, CVS Page, Interleaved, and FAQ Page, Interleaved. 5. Random Controller
The Random Logic Controller acts similarly to the Interleave Controller, except that instead of going in order through its sub-controllers and samplers, it picks one at random at each pass. 6. Random Order Controller The Random Order Controller is much like a Simple Controller in that it will execute each child element at most once, but the order of execution of the nodes will be random. 7. Through put Controller The Throughput Controller allows the user to control how often it is executed. There are two modes - percent execution and total executions. Percent executions cause the controller to execute a certain percentage of the iterations through the test plan. Total executions cause the controller to stop executing after a certain number of executions have occurred. Like the Once Only Controller, this setting is reset when a parent Loop Controller restarts. 8. Runtime Controller The Runtime Controller controls how long its children are allowed to run. 9. If Controller It allows the user to control whether the test elements below it (its children) are run or not. 10. While Controller The While Controller runs its children until the condition is "false". Possible condition values:
blank - exit loop when last sample in loop fails LAST - exit loop when last sample in loop fails. If the last sample just before the loop failed, don't enter loop. Otherwise - exit (or don't enter) the loop when the condition is equal to the string "false"
11. Switch Controller The Switch Controller acts like the Interleave Controller in that it runs one of the subordinate elements on each execution, but rather than run them in sequence, the controller runs the element defined by the switch value. If the switch value is out of range, it will run the zero elements, which therefore acts as the default for the numeric case. It also runs the zero element if the value is the empty string.
12. Transaction Controller The Transaction Controller generates an additional sample which measures the overall time taken to perform the nested test elements. Note that this time includes all processing within the controller scope, not just the samples. There are two modes of operation
additional sample is added after the nested samples additional sample is added as a parent of the nested samples
13. Recording Controller The Recording Controller is a place holder indicating where the proxy server should record samples to. During test run, it has no effect, similar to the Simple Controller. But during recording using the HTTP Proxy Server, all recorded samples will by default be saved under the Recording Controller. Login Config Element The Login Config Element lets you add or override username and password settings in samplers that use username and password as part of their setup
User Defined Variables The User Defined Variables element lets you define an initial set of variables, just as in the Test Plan.
Define the variables in the data grid, then If we add host, where we want to place use ${host} That value automatically assigned to that parameter. Random Variable The Random Variable Config Element is used to generate random numeric strings and store them in variable for use later. It's simpler than using User Defined Variables together with the __Random () function. The output variable is constructed by using the random number generator, and then the resulting number is formatted using the format string. The number is calculated using the formula minimum+Random.nextInt (maximum-minimum+1). Random.nextInt () requires a positive integer. This means that maximum-minimum - i.e. the range - must be less than 2147483647; however the minimum and maximum values can be any long values so long as the range is OK
Assertions Assertions are used to perform additional checks on samplers, and are processed after every sampler in the same scope. To ensure that an Assertion is applied only to a particular sampler, add it as a child of the sampler. If a sub-sampler fails and the main sample is successful, then the main sample will be set to failed status and an Assertion Result will be added. If the JMeter variable option is used, it is assumed to relate to the main sample, and any failure will be applied to the main sample only.
Response Assertion The response assertion control panel lets you add pattern strings to be compared against various fields of the response. The pattern strings are:
Contains, Matches: Perl5-style regular expressions Equals, Substring: plain text, case-sensitive
You can also choose whether the strings will be expected to match the entire response, or if the response is only expected to contain the pattern. You can attach multiple assertions to any controller for additional flexibility. Configuration Elements Configuration elements can be used to set up defaults and variables for later use by samplers. Note that these elements are processed at the start of the scope in which they are found, i.e. before any samplers in the same scope. CSV Data set config CSV Data Set Config is used to read lines from a file, and split them into variables. It is easier to use than the __CSVRead () and _StringFromFile () functions. It is well suited to handling large numbers of variables, and is also useful for testing with "random" and unique values. Generating unique random values at run-time is expensive in terms of CPU and memory, so just create the data in advance of the test. If necessary, the "random" data from the file can be used in conjunction with a run-time parameter to create different sets of values from each run - e.g. using concatenation - which is much cheaper than generating everything at run-time. By default, the file is only opened once, and each thread will use a different line from the file. However the order in which lines are passed to threads depends on the order in which they execute, which may vary between iterations. Lines are read at the start of each test execution. The file name and mode are resolved in the first iteration. See the description of the Share mode below for additional options (JMeter 2.3.2+). If you want each thread to have its own set of values, then you will need to create a set of files, one for each thread. For example test1.csv, test2.csv, testn.csv. Use the filename test${__threadNum}.csv and set the "Sharing mode" to "Current thread". Counter Allows the user to create a counter that can be referenced anywhere in the Thread Group. The counter config lets the user configure a starting point, a maximum, and the
increment. The counter will loop from the start to the max, and then start over with the start, continuing on like that until the test is ended Simple Config Element The Simple Config Element lets you add or override arbitrary values in samplers. You can choose the name of the value and the value itself. Although some adventurous users might find a use for this element, it's here primarily for developers as a basic GUI that they can use while developing new JMeter components HTTP Authorization Manager The Authorization Manager lets you specify one or more user logins for web pages that are restricted using server authentication. You see this type of authentication when you use your browser to access a restricted page, and your browser displays a login dialog box. JMeter transmits the login information when it encounters this type of page. It not shown in tree view listener. HTTP Cache manager The HTTP Cache Manager is used to add caching functionality to HTTP requests within its scope. If a sample is successful (i.e. has response code 2xx) then the Last-Modified and Etag (and Expired if relevant) values are saved for the URL. Before executing the next samples, the sampler checks to see if there is an entry in the cache, and if so, the If-Last-Modified and IfNone-Match conditional headers are set for the request. Additionally, if the "Use Cache-Control/Expires header" option is selected, then the CacheControl/Expires value is checked against the current time. If the request is a GET request, and the timestamp is in the future, then the sampler returns immediately, without requesting the URL from the remote server. This is intended to emulate browser behavior. Note that the CacheControl header must be "public" and only the "max-age" expiry option is processed. By default, Cache Manager will store up to 5000 items in cache using LRU algorithm. Use property to modify this value. Note that the more you increase this value the more HTTP Cache Manager will consume memory, so be sure to adapt -Xmx option. If the requested document has not changed since it was cached, then the response body will be empty. Likewise if the expires date is in future. This may cause problems for Assertions HTTP Request Details This element lets you set default values that your HTTP Request controllers use. For example, if you are creating a Test Plan with 25 HTTP Request controllers and all of the requests are being
sent to the same server, you could add a single HTTP Request Defaults element with the "Server Name or IP" field filled in. Then, when you add the 25 HTTP Request controllers, leave the "Server Name or IP" field empty. The controllers will inherit this field value from the HTTP Request Defaults element. HTTP Header Manager The Header Manager lets you add or override HTTP request headers. Versions of JMeter up to 2.3.2 supported only one Header Manager per sampler; if there were more in scope, and then only the last one would be used. JMeter now supports multiple Header Managers. The header entries are merged to form the list for the sampler. If an entry to be merged matches an existing header name, it replaces the previous entry, unless the entry value is empty, in which case any existing entry is removed. This allows one to set up a default set of headers, and apply adjustments to particular samplers Java Request Details The Java Request Defaults component lets you set default values for Java testing. JDBC Connection configuration
Create a database connection from the supplied JDBC Connection settings. The connection may be optionally pooled between threads. Otherwise each thread gets its own connection. The connection configuration name is used by the JDBC Sampler to select the appropriate connection
Different databases and JDBC drivers require different JDBC settings. The Database URL and JDBC Driver class are defined by the provider of the JDBC implementation. Some possible settings are shown below. Please check the exact details in the JDBC driver documentation.
If JMeter reports No suitable driver, then this could mean either: The driver class was not found. In this case, there will be a log message such as DataSourceElement: Could not load driver: {classname} java.lang.ClassNotFoundException: {classname} The driver class was found, but the class does not support the connection string. This could be because of a syntax error in the connection string, or because the wrong classname was used.
If the database server is not running or is not accessible, then JMeter will report a java.net.ConnectException
Database Driver class Database URL
ingres.jdbc.IngresDriver
org.apache.derby.jdbc.ClientDriver
jdbc:derby://server[:port]/databaseName[;URLAttribute s=value[;...]]
Key store Configuration The Key store Config Element lets you configure how Key store will be loaded and which keys it will use. This component is typically used in HTTPs scenarios where you don't want to take into account key store initialization into account in response time.
Timer
Timers are processed before each sampler in the scope in which they are found; if there are some timers in the same scope, all the timers will be processed before each sampler. Timers are only processed in conjunction with a sampler. A timer which is not in the same scope as a sampler will not be processed at all. To apply a timer to a single sampler, add the timer as a child element of the sampler. The timer will be applied before the sampler is executed. To apply a timer after a sampler, either add it to the next sampler, or add it as the child of a Test Action Sampler
Constant Timer If you want to have each thread pause for the same amount of time between requests, use this timer Gaussian Random Timer It pause each thread request for a random amount of time, with most of the time intervals occurring near a particular value. The total delay is the sum of the Gaussian distributed value (with mean 0.0 and standard deviation 1.0) times the deviation value you specify, and the offset value
Uniform Random Timer This timer pause each thread request for a random amount of time, with each time interval having the same probability of occurring. The total delay is the sum of the random value and the offset value. Constant Throughput Timer This timer introduces variable pauses, calculated to keep the total throughput (in terms of samples per minute) as close as possible to a give figure. Of course the throughput will be lower if the server is not capable of handling it, or if other timers or time-consuming test elements prevent it. N.B. although the Timer is called the Constant Throughput timer, the throughput value does not need to be constant. It can be defined in terms of a variable or function call, and the value can be changed during a test. The value can be changed in various ways:
using a counter variable using a JavaScript or Bean Shell function to provide a changing value
Using the remote Bean Shell server to change a JMeter property Synchronizing Timer The purpose of the Sync Timer is to block threads until X number of threads has been blocked, and then they are all released at once. A Sync Timer can thus create large instant loads at various points of the test plan