Tuesday, January 9, 2018

Using JSON extractor in Jmeter: How to deal with dynamic values in JSON response

How To use JSON Extractor in Jmeter

Json extractor is used like regular expression extractor to capture some dynamic values from the response but used for json only.

By using this we can fetch the values of variables in the Json.

Let me take an example

Below is the Json and its corresponding response:


Here we want to extract the value of variable name "label" or "val"
 which are changing dynamically

We can use Json extractor to fulfil thie purpose here

below is the JSON values that can be used



In this Json extractor blow are the parameters and their corresponding values

Variable Name: Name of the variable (can be used anything logical, here we have used the same as we are getting in response)

JSON Path expression: It is the most important part for JSON configurations, We should use the path extractor expression here.
 Here we have used $..lable , Here two dot means we have json variable in two nested blocks, For normal JSON where there is only one tag , we used single dot.

Match Number: 0 means any random value, here we can use 1 or 2 to get first value or second value and so on, we can also use -1 for getting all possible values to be stored in array (with variable name as mentioned above)

Default Values: this values that can be passed when we didnt got the expected value.


TO varify the value captured in Json extractor:

We can use the Debug Sampler on the thread group to validate the value captured using Json extarctor, Debug sample is used to print all the used defined configured variable in jmeter.


Here we can see that variable "label": captured SpiceJet , and lable_matchNr having value as 10 because there are 10 occurrence of the values corresponding to the expression we have defined for variable label in JSON extractor.


Feel Free to add if i have missed anything.



Tuesday, December 12, 2017

Client Side Response Time/Rendering Time and Server Side Time of Mobile app/Web Application

When we talk about the performance testing of any application weather it is web application of Mobile App. First question comes in our mind is about the user experience of the application.

Most of the tools that are available in the market gives the stats of only one component of this scenario i.e. they only provide the server-side response time. 

But client-side loading time/rendering time is also point of interest if we are taking about the end to end response time.

though not very useful information is available over the google from where you can get the client-side response time and server-side response time as well., but when there is an issue with the performance of the application then it becomes necessary to segregate even if the issue is at server side of at client side.

We can achieve this by a simple formula:

Capture over all page load time
Capture TTFB [Time to first buffer] 

1) There is an issue in page at server side if TTFB is high and difference of load time and TTFB is very low
2) There is an issue at client side if TTFB is very low and high page load time is there

Even we can get the segregation of server-side response time as well as client side response time using the Fiddler while capturing the Mobile App/Web App requestes:

You can easily understand these from the below screenshot:






Below parameters will give us this segregate results:

·  FiddlerBeginRequest – The time at which Fiddler began sending the HTTP request to the server.
·  ServerGotRequest - Exact time that Fiddler finished (re)sending the HTTP request to the server.
·  ServerBeginResponse - Exact time that Fiddler got the first bytes of the server's HTTP response.
·  ServerDoneResponse - Exact time that Fiddler got the last bytes of the server's HTTP response.
·  ClientBeginResponse - Exact time that Fiddler began transmitting the HTTP response to the client browser.
·  ClientDoneResponse- Exact time that Fiddler finished transmitting the HTTP response to the client browser.




Capturing Response time for Andriod App Launcher

Below are the scenario that we have tried to capture the response time of Google Now Launcher activities .

We have tried to capture the response time of below activities taking it as Minor Project : 

Minor Project – QA
Evaluate the performance of Google Now Launcher from Play Store.
• Install the latest version of Google Now Launcher
• Report the average application opening time of Hot-seat icons
• Report the average time to navigate to App Drawer
• Report the average application opening time of App Drawer icons
• Test that on long press the Launcher enters overflow mode
• Test that user is able to change wallpaper of Launcher

All the activities that are mentioned above are client side only and leg time for the same depend on the RAM in the test device, Though we can easily get the matrix for CPU, Memory,Network utilization on device but for capturing leg time, I have tried the following scenarios


1) Manually Using Stopwatch:
                 Major drawback of capturing Response time/Lag Time using this scenario is the non accuracy of the results as response time is in less than a second.
 
2) Using ADB Logs
                  We were expecting the time to be logged in Activity manager line item in the ADB logs, but for application(Purely Client side) like Launchers will not have any activity Manager line item in Logs., This is possible for Native app to get the response time of user activity 

Inline image 1

3) Using Debug Proxy : Not able to record any client side request in Google Now Launcher

4) Using Fiddler : Seems it can give the client side response time, we have tried for some web apps, (refer to attached snapshot), we are facing some issue while downloading and installing fiddler certificate for Andriod and trying to get the same.

5) Using Automation tools(Thought):
                 We can capture the client side response time using  the customization logs in the automation scripts to capture the time stamps , But when we tried this solution for app launhers, we were not able to get the response time for the same.

Apart from these , i have also tried many other things that i found on google, but was unabale to capture the same.

Thursday, October 26, 2017

Performance and Load testing using Neoload - Mobile Application -Part 1

Neoload Record Any Mobile App
·       Direct recording from any device or emulator
·       Recording of native, hybrid and mobile browser apps

Steps for Recording Mobile Application
·       Mobile and your laptop should be on same network on which neoload is working.
·       Configure the cell phone to use Neoload as a proxy.
·       In Mobile, Open Settings à Go To WIFI à Long press the connected networkà Go for Modify network àShow advance Setting àManual à Set Proxy (Input the laptop ip and Neoload port i.e. 8090).
·       Start recording in Neoload
·       Create a project, Below screen will appear.
Recording window

·       Click on start recording .Below screen will appear.



·       Neoload supports client to behave as different option, For mobile select identify as.

·       For Recording through mobile proxy remove the selection from start client and click on OK.


·       Scenario Considered
o   Open xyz App
o   App Dashboard appear
·       Mention the transaction name , Request will get recording in the same as you proceed.
·       Click on stop after recording the scenario the script get recorded.


Let me know in case of any query and keep connected for next part .


Tuesday, June 13, 2017

Mobile App Performance Testing -Part 3


Mobile App Android Client Side Performance Profiling

We have already studied about "How we can perform the server side load testing of Mobile app

Now in this pot we will see the basic concepts and steps to perform the client side profiling of Mobile App

Below techniques can be used:

 Reading android logs using Mlogcat : 

1) Download the MLogcat tool
2) Connect Your Mobile(having debugged app) with system
3) Logs are started in front of you
4) Apply filter based on the process id
5) Copy -paste the logs in excel & delimite to find the elapsed time and queries
6) Report these slow running/duplicate queries and time to developers

Capture Device Hardware Utilisation  Mlogcat :

You can capture the real life CPU Usage/RAM Usage and Network Usage of device

Monitor Thread and Heap Using DDMS:

1) Download Andriod Studio
2) Attached Mobile with Debug build of application
3) Go to Preferences --> DDMS
4) Select your app from left pane
5) Go to Heap tab and monitor the heap
6) Take dump when heap usage reaches close to 100%
7) Analyse the heap using Eclipse Memory analyser for Prime suspects

Feel Free to contact us in case of any query

Join "Performance Testing Expert" Group On Facebook




Tuesday, January 17, 2017

How to Record and Load Test Desktop Applications Using Jmeter (HTTP protocol)

From long time , I was in process to search , how to test the desktop application using Jmeter,

I  have googled many times to find the solution of this problem, Even i knew that this desktop application communicate over HTTP, Still i was helpless to test this application using Jmeter, As the question round around my face was

 " HOW TO RECORD THE DESKTOP APPLICATION USING JMETER"



Thumbs up to my friend, How have done  in depth study of proxies even when he is in manual testing and was able to record the requests for desktop application and prepare the script successfuly

I know many of you were also in search of this from long time , and when i will tell you about this , then surely , you will be in surprise mode for some time and will think , how stupid am i, this is so simple,

Following is the process for recording the Desktop application using Proxy.

1)  Open "Internet Options" from Control Panel, You can also open the same using search at RUN.

2) Click on "Connections" Tab

3) Click on "LAN settings"

4) Under Proxy Server : Enable "Use proxy for your LAN"

5) Put localhost as address and 9091/9092 as port(Avoid using 8080/8888)

6) Click OK

7) Use this Proxy setting in Jmeter Proxy Server

Try to avoid using and opening any other application that use network .

8) Start Proxy in Jmeter and Open the desktop Application,

Now you can see the http requests in the transaction/recording controllers under test thread
and proceed with the script enhancement like parameterisation, correlation, CheckPoint etc

Note: Setting proxies to record  Desktop application is same of browser recording , The only difference is that for desktop application we have to set the proxy on system level in-spite of browser level

Happy Testing
Chota Bheem(Performance Testing Experts)
https://www.facebook.com/groups/189704594726949/

Thursday, August 11, 2016

How to perform the load testing of Microsoft Navision - 2013/NAV 2016 / NAV 2009

In One of my project , I came across to many challenges in Performance testing tool identification  to perform the load testing on Microsoft Navision called as NAV.


Right Now client has application built on NAV 4.0 SP3 and want to migrate to NAV 2013 .
Application used Role Tailored Client to connect to the server.

In last 3-4 days i have read many forums related to the testing of Microsoft  NAV , I am summarising the below information

I am using the below mentioned three approached for tool feasibility Analysis for NAV 2013

1) Using Microsoft VSTS :

  • Application with only Web client can be test through VSTS
  • Load can be populated using only Ultimate version
  • User need to download the Load Testing Framework available on GitHub
  • Framework can be imported in VSTS and the load testing can be done based on the customisation
  • Framework required some DLLs that present in the NAV Setup
2) Using Testing Toolset Kit 
  • Testing Toolset Kit is available with the NAV set up in the Installation DVD
  • Application Toolset Kit contains main file with file extension ".fob"
  • This file needs to be imported in Development environment of NAV
  •  Functional Test Cases can be executed Using Id: 130021 (Page) in fob file
  •  Toolset kit can also be downloaded from partner's site but require credentials.
  •  Kit is also available on mibuso.com
Still I am looking into the options to perform load test executions using the Toolset.
No Information about How to perform load test using Toolset is available over internet, I have also posted the queries regarding the same over many forums of NAV and waiting for reply.

3) Using Load testing tool Like Load Runner, VSTS,Neoload,Silk Performer etc
  •  Next Step is to check the tool feasibility using the above mention tools.

Happy Testing ! All the best!