Mobile Performance Testing with JMeter

Mobile Performance testing for Native and Web App

Spread the love

Being a versatile tool, JMeter can be used for mobile performance testing as well. It provides handy features to prepare and run our mobile specific performance test scripts. Jmeter can help to do performance test for both Android and iOS mobile apps.

Prerequisites:

  • Computer and mobile device should be connected the same network.
  • Apache JMeter & Java JDK has to be downloaded and be installed on your computer.
  • Apache JMeter temporary Root CA must be installed. If it is not installed, HTTPS recording cannot be work.
Recording JMeter Scripts:

Below is the process to record a performance test script in JMeter for Android and iOS platforms.

JMeter proxy configuration

1. Open JMeter and right-click the TestPlan>Add >Threads (Users)>Thread Group.
Performance Testing 0


2. Right-click the Thread group>Add>Logic Controller>Recording Controller.
PT1


3> Right-click the Threads>Add>Listener>View Results Tree.
Performance Testing 2


4> Add test script recorder by selecting TestPlan >Non-Test Elements>HTTP(S) Test Script Recorder option. For Jmeter version greater than 4 user can add Test Script Recorder option by right clicking on TestPlan, Below version of Jemter user can add HTTP(S) Test Script Recorder option by right clicking on WorkBench.
Performance Testing 3


5> Configure the port number to 8080 as below
Performance Testing 4

These were the configurations we need to make in JMeter in order to record the scripts. Now, we need to set up the JMeter proxy in mobile devices so that all mobile requests will be recorded in JMeter. Follow the steps mentioned below to set up proxy in android and iOS platforms.


Now find your IP Address by ifconfig for Linux and ipconfig for Windows. We will load up this IP address on our phone Android/iOS phone to setup proxy.

Performance Testing 5


Mobile side configuration:
Installation of Apache JMeter temporary Root CA:

Where is Apache JMeter Temporary Root CA Located?


ApacheJMeterTemporaryRootCA is located in the Jmeter\bin folder. Certificates have limited lifetime, around 7 days only, if it is expired you will need to reinstall it. If you cannot find this file, When you start JMeter’s HTTP(S) Test Script Recorder, JMeter will generate “ApacheJMeterTemporaryRootCA.crt” automatically.

How to install JMeter Temporary Root CA file?

  • On your computer, rename the file with the .cer file extension, and send the file as an email attachment to an account that you can access from your Android device.
  • Check your email on the Android device.
  • Open the email and tap the attachments button.
  • Then tap the save button. This should save the certificate file to your Android device’s “Download" folder.
  • Next locate and tap the "Settings” icon. This may be located in the “Apps” menu or on one of the device's home screens.
  • Tap the “More” button.
  • Beneath the “Permissions” header tap the “Security” button.
  • In the “Security” menu select the “Install from device storage” from beneath the "Credential storage" header.


  • Performance Testing 6

  • You will now be asked to “Name the certificate”, leave the certificate name as it is and tap “OK”.
  • Performance Testing 7
  • In some versions of Android, your device will ask if you want to use the certificate for "VPN and apps" or "WiFi".
  • In the "Credential use:" options, you should select "VPN and apps".
  • The phone will revert to the security menu and will inform you via a small pop up that the certificate is installed.
  • Performance Testing 8
  • You can check the Certificate is installed by tapping the “Trusted credentials" button.
iOS proxy configuration

  • Go to Settings>Wi-Fi option.
  • Click on the connected network.
  • Select the ‘Manual’ option from HTTP Proxy section.
  • Set the ‘Server’ value as your computer’s IP address and ‘Port’ value to 8080 as JMeter configuration. Refer the image given below to get an idea about this set up.
  • Performance Testing 9
Android proxy configuration

  • Go to Settings>Wi-Fi option.
  • Long tap the connected network and click the ‘Modify Network’ option.
  • From the opened dialog box, check the ‘Advanced options’ check box.
  • This will open advanced settings from which we can modify proxy manually. For this, set ‘Proxy’ option to ‘Manual’.
  • Now, set ‘Proxy hostname’ as your computer’s IP address and ‘Proxy port’ to 8080 as we have set up in JMeter configuration. Refer the below image to get an idea about this setup.
  • Click ‘Save’ option. You can now start running the application on your mobile device and its requests will be recorded in JMeter.

  • Performance Testing 10
6> You can now start running the application on your mobile device and its requests will be recorded in JMeter.

7> But, before running any application, make sure that you click the “Start” button on HTTP(S) Test Script Recorder screen in JMeter.

8> On clicking the “START” button you may get some Root CA Certificate message dialogue. Just click the “OK” button to get rid of it.

Performance Testing 11
9> Once you start running your application, the steps of the script will be recorded under “Recording Controller”.

10> Once you are done with the recording of all steps of the test case, stop the script by clicking the “Stop “button at “HTTP(S) Test Script Recorder screen in JMeter.

Performance Testing 12
11> Expand ‘Recording Controller’ and see all the recorded steps are displayed. See the screenshot below:

Performance Testing 13
12> Now click the “Play” button displayed in green.

13> Click on Veiw Result Tree.

14> Here you will see the execution result of your script.

Performance Testing 14
Conclusion
With a decade long experience in Mobile app testing services and quality assurance, we here at OdiTek Solutions have developed a unique business-driven test management and test execution approach that ensure that your mobile app delivers high quality user experience and at the same time have a lowest possible time-to-market. We use Apache JMeter not only for web testing but also a number of other test functions. We use Apache JMeter 2.7 to test performances of both static and dynamic resources like files, servlets and others. Our developers and testing engineers also use them to simulate heavy load on networks, servers or the object and test the strength; they also analyze and test the performance in different load conditions and types.

To know more about OdiTek's Mobile App Testing with Jmeter, please drop an e-mail at - info@oditeksolutions.com

What Oditek offers


Refer our Skills page:

Performance Testing with JMeter

Performance testing is an important part of any distributed or Web application testing plan. When it comes to enterprise or business class applications, the performance of the system becomes a major focus area. OdiTek aims to provide you best performance testing services using open source...

more

Client Testimonials

We had a tough deadline to launch our .Net based application that processes a lot of data, and got very frustrated with our development agency we hired. Fortunately we got Oditek, and they took over seamlessly the product development, launched the app & continued feature development. Just awesome!

Neal Bonrud

Co-Founder – SubScreener, USA

They were very attentive to our needs as clients and went out of the way to make sure our projects were taken care of. They were always able to get projects done in the specifications we requested. They are passionate about getting things done; I would definitely recommend them to lead any IT projects.

Dann Manahan

Sr VP Technology- 1031 Crowd Funding

OdiTek has been very impressive in delivering a C++ based network security product migration from Linux to Windows. Honestly, we didn’t expect the speed and competencies to get the migration project delivered absolutely on time as the existing product was complex. Technically team is very experienced.

James Rautner

Co-founder- SDSE Networks

I worked with OdiTek on few high profile banking application projects. They did a fantastic job with web applications & manual testing on the VAS apps for two leading banks of UK that included rigorous UAT phases. I recommend them for any application development where security matters.

Clive Shirley

CTO- Smarta, UK

OdiTek is our extended team who works on our key software projects. They are dependable, good in collaboration and technically very much to the level what we expect a global team should be. They had transformed our web applications, CRM and added mobility to existing business platforms here.

Matt Berry

IT Manager- First Option Online

It's been more than 4 years now that we are working with OdiTek on our cloud based web product development. It's been amazing working together, they are very competent on designing scalable, high performance apps. Their technical support is outstanding to say the least, even at odd hours.

Brad Taylor

CEO- BluesummitTech, USA

I am a fan of Team OdiTek since 2014 and have worked on many product development projects together. Specially worth mentioning their deliveries on VAS Banking web application development & manual testing services for Smarta, UK. They are highly skilled & a professional team to work with.

Tom Bowden

Digital Propositions - HSBC, London

OdiTek has been working on our Integrated Web-scale Mobile Platform i.e. Optimal Health since 2014. They are very professional and takes care of the requirements meticulously. They are technically very sound and sincere in ensuring quality & performance. Wonderful working with them!

Catherine Lim

COO- Medilink Global Sdn Bdh

You can trust the team, with minimum supervision you get the work done. They are honest, professional & committed to schedule & quality. I had been successfully running 3 business applications designed, developed and maintained by Oditek developers. It’s been a pleasure working with them.

Scott Evans

CEO- Pink Storage, UK

OdiTek has been working in custom software development, including services for test automation. Many of them have worked with me in 2009-10 when I was R&D Manager in NetHawk India. They have great enthusiasm & a passion to excel in bringing customer success. Their work has been very impressive.

Karen Hamber

Senior Product Manager- Skype

It's amazing to see these guys are turning their experience into a global delivery excellence at OdiTek. I am sure their past large scale product development experience will be handy to product companies. I would always recommend Oditek for software development, especially performance-driven solutions.

Juha Marjeta

Opti Automation Oyj

If you need additional information or have project requirements, kindly drop an email to info@oditeksolutions.com

×