Tuesday, May 17, 2011

Running the Test Plan




To run the test plan you can go to Run menu -> Run or press ctrl + r. To indicate that the test is running a green square lits up in the upper-right-hand corner. After selecting "stop" as well the green light remains on unless and until all test threads exit. Furthermore the total number of currently active threads is indicated by the numbers to the left of the green square. The green square will change to grey Once JMeter  finishes running your Test Plan. You can also stop the test plan in between by selecting Shutdown or Stop from the Run menu.
A file which you want to save the results for in your listener could be opened in any visualizer. The results will be displayed according to the visualizer itself. However you can open the same file in more than one visualizer because during the test run the JMeter will ensure that no sample is recorded more than once to the same file.

Configuring JMeter
The properties of JMeter can be modified by implementing changes in the jmeter.properties in the /bin directory or you can also develop a copy of jmeter.properties on your own by specifying it in the command line.
Some more JMeter properties can be defined in the file as defined by the JMeter propertyuser.properties having the default value user.properties. If the file is in the current directory then it will automatically get loaded. In the same way you can update the system properties fromsystem.properties.
Parameters
 Attribute Description Required
 remote_hosts Comma-delimited list of remote JMeter hosts. You need to list the         machines where you have JMeter remote servers running because then you will be able to control those servers in a distributed environment from this machine's GUI. NO
 not_in_menu With the help of this you can customize your JMeter by allowing only those components to display which you want to by listing their classname or their class label. NO
 user.properties Addition JMeter properties are contained in this file and are added before the -q and -J options are processed and after the initial property file. NO
 xml.parser The default value is: org.apache.xerces.parsers.SAXParser. An implementation can be specified as XML parser. NO
 search_paths This displays the list of paths to search JMeter add-on classes by JMeter such as additional samplers which is in addition to the jars kept in  lib/ext directory.   NO
 system.properties This contains additional system properties which are added before the -S and -D options are processed. NO
 user.classpath A path to be searched for utility classes by JMeter in addition to jars kept in lib directory. NO
 ssl.provider If you don't require the built-in Java implementation then the class can be specified by you for your SSL implementation. NO

Enhancing the Test Plan




As you have seen we have added some basic elements to the Test Plan like Sampler and some listeners. Similarly you can add many other elements in your Test Plan as shown under Group heading.
 Group  Purpose
 Samplers  The requests to the servers are being sent by these elements for the request types SOAP, JDBC,"Java", HTTP/HTTPS, FTP,
 Listeners  The results of the run can be saved by these elements in the single request, tabular forms etc by saving the results in a named file.
 Timers  To make the test more realistic we use Timers element to insert delays between the requests. 
 Logic  Logic controllers are used if you have defined the request to be executed on some logic like if-then-else and loop structures in Java etc.
 Configuration Elements  common information about the requests is added to work with samplers using this element.  
 Assertions  This element is used to check whether you are getting the responses within a given amount of time containing the expected data or not.
What does Apache JMeter do?
  • Loads and does the performance test for HTTP and FTP servers and arbitrary database queries.
  • Does the Caching and offline analysis of test results.
  • concurrent sampling by many threads as well as sampling of different functions by seperate thread groups simultaneously.
  • Its extensibility includes:      
                        supports Scriptable Samplers such as BeanShell and BSF-compatible languages.
                        More extendibility and personalization allowed by Data analysis and visualization.
                        Unlimited testing capabilities by Pluggable Samplers.
  • Complete portability
  • Faster operation and more precise timings is done by GUI design. 
  • Supports Full Swing and lightweight component. 
JMeter is not a browser
Well, don't take it as a browser at all because Jmeter does not perform the actions supported by browsers as far as web-services and remote services are concerned. No Javascript is executed by the JMeter found in HTML pages. However it sometimes happens that the response could be viewed as HTML etc excluding the timings in any samples. Remember, you can view only one sample in one thread at a time.
Error reporting
Errors and warnings are also depicted by the JMeter. These errors and warnings are reported to thejmeter.log file by the JMeter including some information which runs itself on the test. Some errors which are not depicted by the JMeter may appear on the command console. You need to check the log file for any errors being reported if in case the test performed by you is not going the way to be expected. For instance a syntax error in a function call might be reported in the log file.
The errors which are not trapped and logged by the JMeter get stored as attributes of the sample result. For instance sampling errors like HTTP 404 - file not found etc get stored as attributes of the sample result.