DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Recording a Scenario in Mobile Applications

Learn how to record scenarios in your mobile app to make for easier, more effective testing.

Canberk Akduygu user avatar by
Canberk Akduygu
·
Dec. 04, 18 · Tutorial
Like (1)
Save
Tweet
Share
5.76K Views

Join the DZone community and get the full member experience.

Join For Free

Mobile app users demand high performance at all times and rarely give a second chance to an app that performs poorly. For this reason, you have to make sure to prepare your app in advance by executing a proper load testing process. To start with, here we will show you the steps you can take to record the scenario in a mobile app with JMeter.

Prerequisites 

First of all, you have to connect your mobile device and JMeter installed a computer on the same network. By doing so you enable your computer to be a proxy for your mobile device.

Step 1: Configure

Create a blank Test Plan and add an HTTP(S) Test Script Recorder to record mobile devices’ activity.

test script recorder

You need to set an unused port value. Generally, 8888 should work fine in case you have nothing running on it.

https_test_script

Step 2: Creating the Test Plan

You need to add a Thread Group to your JMeter file.

add_thread_group

Then you should add a “Recording Controller” under it, to store the request captured from the proxy.

recording_controller

Step 3: Configure Mobile Devices

You need to set up your mobile device’s proxy settings

In an iOS device, follow these steps;

  • Settings —> Wi-Fi —> Your connected network
  • Choose Manual from HTTP Proxy section
  • Add server value, Server = Computer’s IP address
  • Add Port value , Port = JMeter’s Port value

add_thread_group_jmeter

In an Android device, follow these steps;

  • Settings —> Wi-Fi —> Your connected network
  • Show advanced options
  • Choose Manual from HTTP Proxy section
  • Add Proxy hostname value, Proxy hostname = Computer’s IP address
  • Add Proxy Port value, Proxy Port = JMeter’s Port value

Now your device will use your computer as a proxy in the defined port and ip address.

Step 4: Start Recording

Open the HTTP(S) Test Script Recorder and click the Start button. Right now, JMeter is running as a proxy and able to capture any request coming from the device that’s connected to its IP.

test_plan_creation

When you click on the Start button, you’ll receive a message about the “Root CA certificate ApacheJMeterTemporaryRootCA created bin directory” dialogue.

Just click the OK button. In case you don’t add this certificate to your device, you will not be able to capture HTTPS traffic. You’ll only capture HTTP ones.

apache_jmeter

Step 5: Install the Certificate

Just send this certificate located in the bin folder of your JMeter root folder to the mobile device and install it by clicking on it.

Step 6: Analyze the Recorded Script

Just start the application or your mobile browser and execute your scenario on it. You will notice that every request will be stored under the “Recording Controller”. All you need to do is to clean the unnecessary request coming from other app’s running on the device cause JMeter proxies them too. Then manipulate the script with dynamic variables for a realistic performance test script.

http_request

You can test your mobile app's performance easily.

Happy load testing!

mobile app

Published at DZone with permission of Canberk Akduygu. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • What Java Version Are You Running? Let’s Take a Look Under the Hood of the JDK!
  • Public Cloud-to-Cloud Repatriation Trend
  • Exploring the Benefits of Cloud Computing: From IaaS, PaaS, SaaS to Google Cloud, AWS, and Microsoft
  • Project Hygiene

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: