Mobile app users are demanding high performance at all times and they 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.
JMeter records mobile application requests on HTTP(S) Script Recorder and it has features to prepare and run our mobile application performance test scripts. All we have to do is to configure JMeter and Mobile device. In JMeter, we can test both iOS and Android native applications.
• Launch the JMeter in Admin mode METER_HOME/bin, Start jmeter.bat or jmeter.sh.
• Under JMeter Test Plan –>Workbench, add ‘HTTP(S) Test Script Recorder’.
• You can add a ‘View Results Tree’ under ‘HTTP(S) Test Script Recorder’ to see the request & response details while recording. (It is not mandatory to have it.)
• Connect the Mobile Device and system with same Wi-Fi network.
• Setup the any port number, 2020 and click start button.
• JMeter will create a certificate –ApacheJMeterTemporaryRootCA.crt under JMETER_HOME/bin Send the certificate to your email.
iOS Device(iPhone) Setup:
• In your ipad/mobile device, open the – ApacheJMeterTemporaryRootCA.crt – file & Install. We would need this if the iOS app uses HTTPS which will lead to SSL handshake issue.
• Trust the certificate- Setting>General>About>Certificate Trust Settings ,Turn On that certificate Button.
• On your Iphone Mobile, go to Settings > Wi-Fi and click the arrow next your Wi-Fi connection. Under “HTTP Proxy”, select the Manual button and enter your desktop’s IP address in the Server field. Then enter “2020″ in the Port field.
• Now navigate your business flow and Jmeter start recording your mobile application.
Android Device Proxy Configuration:
#1. Go to Settings > Wi-Fi option.
#2. Press and hold on connected network and Click ‘Modify Network’ option.
#3. This will open advanced settings from where we can modify Proxy.
#4. Change the Proxy to Manual.
#5. Set Hostname value as system IP address and Port value to 8080 as per JMeter setup.
Click on ‘Save’.
#7. Now start the application on the device and its each request will be recorded in JMeter.
#8. Before running the application, make sure that HTTP(S) script recorder was started in JMeter.
#9. Once the application is started, the actions of the script will be recorded under “Recording Controller.”
#10. Once actions are done in the application, stop the script recording by clicking ‘Stop’ button in HTTP(S) script recorder screen.
#11. Now, expand the “Recording Controller” in JMeter. You can view all the Recorded scripts of whatever actions are done in the applications.
#12. Finally, click the ‘Play’ button. It will run recorded scripts as per your Threads setup.
#13. Click on “View Results in Tree”. Here you will see the result of your script.