Jmeter with Mobile

02 / May / 2016 by Parkash Goswami 3 comments

Jmeter is known for Performance and Functional testing tools for Web, but Jmeter can also record scripts for Mobile Applications. You can record and play script from Jmeter and quickly verify Mobile application performance and functional aspects. Jmeter has features to prepare and run our mobile specific performance test scripts. We need to do configuration on Jmeter and mobile devices, Find below mentioned steps to do configuration:

Steps to do JMeter proxy configuration:
1. Open JMeter and right-click the TestPlan>Add >Threads (Users)>Thread Group.

1

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

2

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

3

4. Add test script recorder by selecting Add>Non-Test Elements>HTTP(S) Test Script Recorder option.

4

5. Add ‘8080’ as Port value and click the Start button. This will start the JMeter proxy on localhost.

5

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

6

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.

Android proxy configuration

1. Go to Settings>Wi-Fi option(WiFi network should be same for both Mobile and Laptop/Desktop).
2. Long tap the connected network and click the ‘Modify Network’ option.
3. From the opened dialog box, check the ‘Advanced options’ check box.
4. This will open advanced settings from which we can modify proxy manually. For this, set ‘Proxy’ option to ‘Manual’.
5. 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.
6. Click ‘Save’ option. You can now start running the application on your mobile device and its requests will be recorded in JMeter.
iOS proxy configuration

1. Go to Settings>Wi-Fi option.(WiFi network should be same for both Mobile and Laptop/Desktop).
2. Click on the connected network.
3. Select the ‘Manual’ option from HTTP Proxy section.
4. Set the ‘Server’ value as your computer’s IP address and ‘Port’ value to 8080 as JMeter configuration.

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

8

6. You can now start running the application on your mobile device and its requests will be recorded in JMeter.
7. On clicking the “START” button you may get some Root CA Certificate message dialogue. Just click the “OK” button to get rid of it.

6

8. Once you start running your application, the steps of the script will be recorded under “Recording Controller”. See the screenshot below:

9

9. 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.

10. Expand ‘Recording Controller’ and see all the recorded steps are displayed.

11. Now click the “Play” button displayed in green.

12. Click the “View Result Tree”.
13. Here you will see the execution result of your script.

FOUND THIS USEFUL? SHARE IT

comments (3)

    1. Parkash Goswami Post author

      Thanks Vikas, We can do it for mobile web also, as it will capture all API’s which will be hit during recording script.

      Reply

Leave a comment -