Mobile Performance Testing: Record Script in JMeter
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. In this tutorial, we have explored and listed down steps to record a performance test script in JMeter for Android and iOS platforms.
It’s not much different from what we do to record script for web applications. All we have to do is put proper proxy in place for mobile device. We’ll see how to do it further in this post but first, let’s prepare JMeter to record our script.
JMeter proxy configuration:
- Open JMeter and right click on WorkBench.
- Add test script recorder by selecting Add–>Non-Test Elements–>HTTP(S) Test Script Recorder option.
- Add 8080 as Port value and click Start button. This will start the JMeter proxy on localhost. (For more details about test script recorder fields, refer this article.)
Now we need to setup the JMeter proxy in mobile devices so that all mobile requests will be recorded in JMeter. Perform below steps to setup proxy in Android and iOS platforms.
Android proxy configuration:
- Go to Settings–>Wi-Fi option.
- Long tap on connected network and click ‘Modify Network’ option.
- From the opened dialog box, check ‘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 setup in JMeter configuration. Refer below image to get an idea about this setup.
- Click Save option. You can now start running the application in your mobile device and its requests will be recorded in JMeter.
iOS proxy configuration:
- Go to Settings–>Wi-Fi option.
- Click on your connected network.
- Select ‘Manual’ option from HTTP Proxy section.
- Set ‘Server’ value as your computer’s IP address and ‘Port’ value to 8080 as JMeter configuration. Refer below image to get an idea about this setup.
- You can now start running the application in your mobile device and its requests will be recorded in JMeter.
We hope you were able to record JMeter script for mobile performance testing after following above steps. Let us know how it goes for you.
Great as usual, thumbs up. Just a little update, there is an easier way of recording any mobile applicaiton (yes, including native ones and yes, including SSL traffic) via Mobile Recorder which is absolutely free and 100% JMeter compatible
Sub : Native Mobile Appllication HTTPS: Script recording issue in JMeter
I am using Jmeter 2.13 and android emulator (4.2.2 API 19) for mobile native application (https) recording.
Mobile Application running fine in android emulator.
For script record i configure Jmeter proxy on emulation,(proxy : my host ip and port 8080).
When sent request from emulator is shown error as “Network Connection Exception” and not request failed. nothing is record. (without jmeter proxy running file).
Kindly guide me
Sub : Native Mobile Appllication HTTPS: Script recording issue in JMeter
I am using Jmeter 2.13 and android emulator (Andy_v46.2_x64) for mobile native application (https) recording.
Mobile Application running fine in android emulator.
For script record i configured Jmeter proxy on emulation,(proxy : my host ip and port 8080).
When sent request from emulator , nothing is record. (without jmeter proxy running file).
Kindly guide me
Hi,This is just for recording web application from mobile only.or we can record mobile apps also.
please kindly let me know.
Can we use Jmeter for window phone ???
This didnt work for me. plz let me know if anything else required. I set the proxy in my handset, the in my handset opened few android app, it didnt record anything.
Hi,
I’ve connect android device (5.1.1) with jmeter. When i start recording i can record steps performed on browsers but not with Native App. Please suggest any solution.
Record the APIs using Blazemeter Recorder and then convert all the requests into jmx file and run that in jmeter.
This link will helps you to record the requests from androd application https://a.blazemeter.com/app/recorder/index.html
Jmeter mobile app testing refer :
: : https://ialiras.blogspot.in/2016/09/for-android-devices-a.html?m=1
After setting the proxy in the mobile save button is disabled. Can you please telll what could be the reason.
Why because you did not entered the correct ip above the port number
you should enter both proxyname and proxyport
Added all things but recording is not going on please help me out.
My ip with local host 8080 clear aal previous data and click on Start but no recording is going on.
Please help me.
android application and PC where Jmeter runs should connected to same network or what ?
yes both system and mobile device should be connected to same wifi