CategoryPerformance Testing

Gatling the Beginning

We are living in the world of technologies, it changes the way we work, the way we look at the things. We search queries in google, do shopping online, share a moment in Facebook, chat with our childhood friends irrespective of where they live. Everyone likes if the tasks are simplified or automated by online solutions and gives more sophistication on our needs. Hence it is more important to design the web application by considering the performance factors such as concurrency, response time, fault tolerance, scalability. Though there are so many load testing tools available in the market, Jmeter and Gatling are considered as widely used tools. These two tools are open source and offers support for protocol testing.

We had seen already about Jmeter and how it helps QA to identify performance bottlenecks without worrying much on coding part  as Jmeter offers built-in components like Logical controllers, Samplers for protocols like http,ftp,Soap,Jms etc…, listeners for reports, Config elements like CSVDatasetConfig for customizing user data, Pre-Processors , Post-Processors such as Regex-Extractor, JMXMon for Monitoring the heap parameters of the Web application. I like Jmeter so much and used it for longer period. It servers the purpose of finding the performance bottleneck. Just for a change I would really like to try Gatling and hereafter i will post more about my gatling experience.

Introduction on Gatling
Gatling is developed and maintained by Stephene Landelle. Gatling is well known for its speed and performance as it is built on AKKA Engine, scala language based. Gayling works on asynchronous model. Gatling does not lock the thread at the jvm level, so there is no one user per thread concept. After thread completes it tasks , it will be released and takes the next task. Currently Gatling supports more on HTTP protocol , also they support JMS protocol.

Download Gatling from the following location, Latest version is Gatling 2.1.7
http://gatling.io/#/download

When you open Gatling you can see the following folders

bin
It has gatling recorder and gatling to run simulations for both windows and linux

conf
Gatling configuration files are placed here

lib
lib folder has Gatling Jar files , Scala libararies, netty libraries

results
results folder basically consists of simulation results, html files

target
where simulation class files can be found

user-files
user files are placed under data folder of this user-files directory.
simulation files are inside /user-files/simulation folder.

How to Transfer/Refer Jmeter Variables from one Thread Group to another Thread Group?

jmeter1

In many situations we encounter in referring the variables from one thread group to another. Even i found myself every time I end up in searching for the solution. Finally I have decided to write it here ,there are many ways to transfer variables, I preferably choose the following method.

1) Set up Thread Groups
2) Add a “BeanShell Assertion” to the sampler where you are extracting the value
3) In the Script area of BeanShell Assertion specify as
${__setProperty(SG_Id2,${SG_Id1})} where SG_Id2 is a variable in which we are storing the value of
SG_Id1 , so that we can refer this value anywhere in the testplan across all the thread groups.
4) Now go to next Thread Group sampler where you want to pass the value and give as
${__property(SG_Id2)}
5) Now run the test and check the value passed from one thread group to another thread group

How to execute a test continuously for specified duration without bothering no. of times using JMETER?

Scenario:

Do you have the following scenario to execute by Jmeter and not able to find the solution?

Having HTTP Request / REST Request in a test plan, required to execute the test for 1 hour duration without bothering repetition , and to

  • Find the application robustness and consistency to bear max load?
  • Find no. of requests application can handle for the specified duration?

and you would have

  • tried giving in scheduler but not worked as it executes for the number of threads specified In thread group.
  • tried giving in Duration but not worked. So what is next?

Solution:

  • Check ‘Forever’ check box in Thread group
  • Give Duration as ‘3600’ in Scheduler section of Thread Group

image

Enjoy Testing  Smile

© 2017 My techbook

Theme by Anders NorénUp ↑