Categories
Performance Testing testing

Websphere MQ

As per IBM notes

IBM WebSphere MQ can transport any type of data as messages, enabling businesses to build flexible, reusable architectures such as service-oriented architecture (SOA) environments. It works with a broad range of computing platforms, applications, web services and communications protocols for security-rich message delivery. WebSphere MQ provides a communications layer for visibility and control of the flow of messages and data inside and outside your organization.”

WebSphere MQ provides:

  • Versatile messaging integration from mainframe to mobile that provides a single, robust messaging backbone for dynamic heterogeneous environments.
  • Message delivery with security-rich features that produce auditable results.
  • High-performance message transport to deliver data with improved speed and reliability.
  • Administrative features that simplify messaging management and reduce time spent using complex tools.
  • Open standards development tools that support extensibility and business growth

More details can be availed from IBM website

dist_400px

 

 

 

 

 

 

 

 

For more information on Load testing IBM Websphere MQ using Jmeter check here.

Categories
Performance Testing testing

Loadtesting Websphere IBM MQ server using JMETER

 

 About :

For Loadtesting Apache Active MQ , JMS-Point-to-Point sampler in Jmeter will help us. Think that you do not have JNDI settings and no apache activemq for JMS messaging, instead IBM Websphere MQ is in place.  One day your manager is coming and asking you to test IBM MQ using open source testing tool as they do not ready to pay for small scale performance testing.

In that case , here is the steps to use Jmeter to load test IBM Websphere MQ.
The content here is pretty much precious and definitely it will save your valuable time 🙂

  • Below are the Java and MQ jars needed.  Download these jar files and place it under Jmeter’s libext directory. ‘jmeter-jms-skip-jndi-0.0.1.jar‘ is the jar contains the MQ declaration and coding to connect it. You can down it from the URL :http://www.java2s.com/Code/Jar/j/Downloadjmeterjmsskipjndi001jar.htm
    • com.ibm.mq.jar
    • org.springframework.beans.jar
    • org.springframework.jms.jar
    • javax.jms.jar
    • jmeter-jms-skip-jndi-0.0.1.jar
    • spring-core.jar
  •  Open Jmeter -> File-> New->TestPlan -> Add Thread Group
  • Under Thread Group add Samplers->JMS Point-to-Point Sampler and configure the parameter. As given in the below Screenshot.
  •  Run Jmeter Script and Enjoy IBM MQ load testing .

MQ1

Categories
Performance Testing

Jmeter Problems and Solutions

1) How to handle sessions in Jmeter?

Add->Pre-Processors->HTTP URL Re-writing Modifier for the sampler where your session variable is present
Then add your variable in session argument name and check cache session id.
Please see the image below:

Jmeter_SessionHandling

2) How to customize the user data/ how to run the script for multiple users in Jmeter?

i) Add Thread Group->Config Element-> CSV Data config Element
ii) Give user variables for the csv file column.
iii) Place the CSV in the same folder where you kept the JMeter script or give full file path in the filename, see the images below:

Jmeter_CSV1

Jmeter_CSV

3) How to run the Jmeter for more than 300 users?

i) Run in Non-GUI distributed mode to run for more than 300 users. It depends on the RAM size. For the system with 3.2 GB, you can run up to 1000 users.

Step1:
Configure Jmeter for Distributed testing

Step2:
Place your script and CSV in /bin folder of the JMeter.

Step3:
Open a command prompt, go to JMeter bin directory and give the following command

jmeter -n -t testplan.jmx -R ip1,ip2 -l resultfilename

4) How to record Jmeter script?
you can capture headers and parameters of the request by Fiddler or HTTPWATCH and write the script manually, or configure proxy and use Recording controller.

A detailed manual is available on Apache Site:
http://jmeter.apache.org/usermanual/jmeter_proxy_step_by_step.pdf

5) How to extract the data using regex in Jmeter?

There is an element called preprocessor->regularexpression.

Add it under the request you want and then follow the below steps:

i) Give reference name (any name, that will be substituted in the place of an actual parameter value in the request)

ii) Give the regular expression, for example, if the text to be extracted is ‘world’ from text=’world’, then the regex will be like this text='(.+?)’

iii) Give template as $1$

iv) Match No would be which row of the value from the web page, it may be 1, 2,3, etc. If you want a random row then give ‘0’

v)Default value is a string that will be sent to the server when it fails to extract the data. it can be anything for Ex: Loginid_Failed

Please see the image below:

Jmeter_Regex

6) what are the characters used in regex?

Regular Expressions use certain characters and those have special meaning. The following are the list of such characters.
( ) : grouping
[ ] : character classes
{ } : repetition
* + ? : repetition
. : wild-card character
: escape character
| : alternatives
^ $ : start and end of string or line

7) How can I use special characters with actual meaning in regex?

Add backslash to the special character to mean it as it is, for example (),$,^.

8)  Mention example for regular expression to extract string with whitespace

Regular Expression : <url.values+(.+?)=”(.+?)”

Explanation:

<url.value    : Extract the string <url.value

<url.values  : Extract the string <url.value followed by white space

<url.values+Extract the string <url.value followed by white space and

<url.values+(.+?) : Extract the string <url.value followed by white space and any character with 1 or more match

<url.values+(.+?) =  : Extract the string <url.value followed by white space and any character with 1 or more match with equals symbol 

<url.values+(.+?) =”(.+?)” : Extract the string <url.value followed by white space and any character with 1 or more match with equals symbol  and any charcter with 1 or more matches inside double quotes.

So the final string returned from the above condition maybe like this:

<url.value groupid=”1234trurbd93737″

9) How to use java program inside Jmeter?

Java program can be called inside JMeter by using BeanShell Pre/Post Processor.

10) How to send files with Jmeter script?

There is a column in HTTP request as ‘ Send Files with the Request’

Give the file path, parameter name, and MIME type.

For sending different files, give it in CSV file and add the variable in CSVconfig Element. (Any question related to this, you can post your questions)

11) How to capture Jmeter results?

There are a lot of graphs/listeners available for JMeter. Or if the purpose is to find response time for the request, use ‘Aggregate Report’ and take a min, max, avg timings(in milliseconds). That will help a lot.
Or you can download a plugin for colorful graphs.

http://code.google.com/p/jmeter-plugins/

Jmeter_AggregateReport

12) How to View the results of the JTL file created in NON-GUI mode?
Open any Jmeter script, go to Aggregate report listener, Browse the file and Open it. After that, you can save it as a CSV file.

13) How to test ‘HTTPS’ applications using Jmeter?
In HTTP Request default, mention the protocol as ‘https

14) How to rectify Jmeter out of memory error-heap space when opening Jmeter?
Right Click and Edit Jmeter.bat file, increase Xmx value, and check.

15) Where to Download Jmeter latest version?
https://jmeter.apache.org/download_jmeter.cgi

16) How to execute the ssh command or shell script on a remote server using Jmeter?
Using SSH sampler it can be done. For a detailed explanation see here
https://www.technix.in/execute-linux-command-shell-script-apache-jmeter/

17) How to run an endurance test using Jmeter for more than 8 hours?

Using Timers, it is possible to run endurance test using JMeter, please look at this

https://www.technix.in/run-overnight-endurance-test-consecutively-using-jmeter/

Categories
Performance Testing

Introduction to Jmeter

Apache JMeter is a 100% pure Java desktop application designed to load test client/server software. It may be used to test performance both on static and dynamic resources such as static files, Java Servlets, CGI scripts, Java objects, databases, FTP servers, and more. JMeter can be used to simulate a heavy load on a server, network or object to test its strength or to analyze overall performance under different load types.

Version

Go for apache Jmeter 2.3.4 which supports Badboy Scripts as we have to record web application scripts using Badboy tool and import the scripts from Badboy to Jmeter.
Overview of the Jmeter Components:

Thread Group

Thread group elements are the beginning points of any test plan.
All controllers and samplers must be under a thread group.
Other elements, e.g. Listeners, may be placed directly under the test plan, in which case they will apply to all the thread groups.
As the name implies, the thread group element controls the number of threads JMeter will use to execute your test. The controls for a thread group allow you to:
• Set the number of threads
• Set the ramp-up period
• Set the number of times to execute the test

Ramp-up period

The ramp-up period tells JMeter how long to take to “ramp-up” to the full number of threads chosen.
If 10 threads are used, and the ramp-up period is 100 seconds, then JMeter will take 100 seconds to get all 10 threads up and running. Each thread will start 10 (100/10) seconds after the previous thread was begun. If there are 30 threads and a ramp-up period of 120 seconds, then each successive thread will be delayed by 4 seconds.

How to define Ramp-Up Period???

Ramp-up needs to be long enough to avoid too large a work-load at the start of a test, and short enough that the last threads start running before the first ones finish (unless one wants that to happen).
Start with Ramp-up = number of threads and adjust up or down as needed.
By default, the thread group is configured to loop once through its elementsSamplers:
Samplers perform the actual work of JMeter. Each sampler (except Test Action) generates one or more sample results. The sample results have various attributes (success/fail, elapsed time, data size etc) and can be viewed in the various listeners.