2016-07-21

Stress testing is a type of performance testing focused on determining an application’s robustness, availability, and reliability under extreme conditions. The goal of stress testing is to identify application issues that arise or become apparent only under extreme conditions.
The Apache JMeter application is open source software, a 100% pure Java application designed to load test functional behavior and measure performance. It was originally designed for testing Web Applications but has since expanded to other test functions.
JMeter Features
1-Ability to load and performance test many different server/protocol types: Web-HTTP, HTTPS, SOAP,FTP,Database via JDBC,LDAP,JMS,Mail-POP3, IMAP
2-Complate portability and %100 Java purity
3-It has full Swing and lightweight component support (precompiled JAR uses packages javax.swing.* )
4-Its full multi-threading framework allows concurrent sampling by many threads and simultaneous sampling of different functions by separate thread groups.
5-It has a simple and intuitive GUI.
6-Caching and offline analysis/replaying of test results.

7-Highly Extensible core:

Pluggable Samplers allow unlimited testing capabilities.
Several load statistics may be chosen with pluggable timers.
Data analysis and visualization plugins allow great extensibility as well as personalization.
Functions can be used to provide dynamic input to a test or provide data manipulation.
Scriptable Samplers (BeanShell, BSF-compatible languages and JSR223-compatible languages)

To run JMeter, run the jmeter.bat (for Windows) or jmeter (for Unix) file. These files are found in the bin directory. After a short time, the JMeter GUI should appear.

JMeter Http Request Application
There is already an empty Test Plan existing on JMeter. We start by adding a ‘Thread Group’ to our Test Plan. A Thread Group is something where you configure how many users you want to mimick. In the example below, I have got 100 users to hit the target within a timespan of 1 seconds.
Test Plan->Add->Threads->Thread Group

Then, we adding a sampler http Request type. So we can specify the url we’ll test.
Thread Group->Add->Sampler->Http Request

We need a way of looking at the test results. And for that, we need to add some ‘Listeners’ to our Thread group. There are quite a few Listeners in there and they all capture exactly the same data, the only difference is how they treat the data. Each Listener has its own purpose and analyses the data differently. I have added 2 Listeners to my Test Plan above. ‘View Results in Table’, ‘Responce Time Graph‘.
Test Plan test->Add->Lİstener->Responce Time Graph, Test Plan->Add->Lİstener->View Result in Table
That’s it. The Test Plan is ready. We can now run the Test Plan and if everything has been setup properly, we should see the data coming in the Listeners.


Non-GUI Mode(Command Line Mode)
For non-interactive testing, you may choose to run JMeter without the GUI. To do so, use the following command options:
-n This specifies JMeter is to run in non-gui mode

-t [name of JMX file that contains the Test Plan].

-l [name of JTL file to log sample results to].

-j [name of JMeter run log file].

-r Run the test in the servers specified by the JMeter property “remote_hosts”

-R

Run the test in the specified remote servers

The script also lets you specify the optional firewall/proxy server information:-H [proxy server hostname or ip address]-P [proxy server port]Function and VariablesJMeter functions are special values that can populate fields of any Sampler or other element in a test tree. A function call looks like this: ${__functionName(var1,var2,var3)}   Some functions,    samplerName:  get the sampler name (label), machineName:  get the local machine name, log:  log (or display) a message (and return the value) ,StringFromFİle: read a line from a file, XPath: Use an XPath expression to read from a file,  BeanShell: run a BeanShell script                                                                                                                                                                                                                                                                         Pre-Defined VariablesMost variables are set by calling functions or by test elements such as User Defined Variables; in which case the user has full control over the variable name that is used. However some variables are defined internally by JMeter. These are listed below.

COOKIE_cookiename – contains the cookie value

JMeterThread.last_sample_ok – whether or not the last sample was OK – true/false. Note: this is updated after PostProcessors and Assertions have been run.

START variables

For more: http://one-security.org

Show more