Configuration Management Tool Windows

Apache JMeter Load Testing: Test Mobile Apps on Windows

Apache JMeter Load Testing: Test Mobile Apps on Windows

JMeter is an Open Source Java application designed to measure performance and load test applications. Apache JMeter can measure performance and load test static and dynamic web applications. It can be used to simulate a heavy load on a server, group of servers, network, or object to test its strength or to analyze overall performance under different load types. Performance testing on your Mobile App is easy to achieve using JMeter which will help to record mobile application traffic. All that is required is just some configuration of the proxy for mobile applications.

You may want to know the difference between testing and debugging and you may want to read more on other configuration settings you can read these: Configuration Manager Tools: How to install and debug logs with the CMTrace Tool, How to install and configure Ansible on Azure Virtual Machine, Keepalive Settings: Understanding keepalive configuration, Installation and configuration of Cockpit on CentOS Linux

Setting up JMeter Configuration

Follow the below steps on setting up the JMeter Configuration:

  1. Launch the JMeter. Give your Test Plan a name.
  2. Right-click the Test Plan > Add > Threads (Users) > Thread Group.
Setting up a thread
Setting up a Thread

3. Right click the Thread group > Add > Logic Controller > Recording Controller.

setting up a recording controller
setting up a recording controller

4. Now Right-click the Threads > Add > Listener > View Results Tree. This will help to display the outcome of the test result.

etting up a view result tree
setting up a view result tree

5. Now Add > Non-Test Elements > Add HTTP’s test script recorder.

Setting up  the test script recorder
Setting up the test script recorder

6. Go to Global settings and set port to 8888 (or any available port). Select the Target Controller from the drop-down

Select HTTPS Test Script Recorder
HTTPS Test Script Recorder

7. Then click on the Start button displayed on HTTP(S) Test Script Recorder, and a dialog box will be opened that will allow for Root CA Certificate. Then click the “OK” button after.

Click OK to set up root certificate
Setting the Root Certificate

How to install the certificate in Firefox

To proceed with Apache Jmeter load testing, do the following: Go to Privacy & Security

Go to Privacy & Security
The Privacy and Security

Click on Import browse to the JMeter launch directory, and click on the file ApacheJMeterTemporaryRootCA.crt, press Open

Click on Import to import Jmeter Certificate
Importing the JMeter Certificate

Click View and check that the certificate details agree with the ones displayed by the JMeter Test Script Recorder.

  • If it is the same then select “Trust this CA to identify web sites“, and Click OK
Check Trust this CA to identify websites
Trusting the CA

How to add the certificate in Chrome and Internet Explorer

Alternatively, if you have Chrome or IE you can still perform load test using Jmeter. To do this, you can install the certificate In Chrome and internet explorer same way by doing these:

  • Go to Privacy and Security and Click on Manage certificates.
  • Click on Import and browse to the JMeter launch directory, and click on the file ApacheJMeterTemporaryRootCA.crt, and open it
  • You can also click on the “Details” tab and confirm that the certificate details agree with the ones displayed by the JMeter Test Script Recorder
Apache Jmeter Load Testing on Chrome - Click on Privacy & Security, then Import to import Jmeter Certificate
Managing Certificate

Configure the proxy on your Smartphone

As part of Apache JMeter Load Testing, you’ll configure a proxy on the mobile device. This intercepts all traffic, focusing on mobile app data during Text script recorder playback on Windows. Results are then reported to JMeter for in-depth analysis. If you will be using an emulator as your mobile device you will have to configure the same proxy settings on the emulator.

  • Go to settings and find the wireless networks you are connected.
  • Left-click this network and hold it down and wait for the menu to pop out then select Modify Network.
  • Click the dropdown in advanced settings.
  • In the Proxy drop-down select Manual.
Apache Jmeter Load Testing - Set up a Proxy on mobile
Modify wifi network

Confirm your system IP using the ipconfig command in the command prompt.

  • Copy it and paste it into Proxy hostname of your emulator.
  • Make sure you enter the same Proxy Port with the same one you enter in the HTTP(S) Test Script Recorder settings in Apache JMeter.

Leave the DHCP value as dynamic and click save.

Apache Jmeter Load Testing -  Set up proxy name on mobile
Setting Proxy

Setting Up JMeter on Mobile

After installing the JMeter Certificate on your Windows system then you will need to copy the Apache JMeter certificate to your smartphone or to the emulator you plan to use. The file is called ApacheJMeterTemporaryRootCA.crt. and can be found in the JMeter installation directory bin folder. Follow the steps below in other to properly install the certificate on your mobile device not just running the certificate file.

  • Go to your phone or emulator settings > Security > Install from an SD card. Make sure you already copied the file to this location and remember that this setting may be different from one device to another.
Install Jmeter from SD Card - Apache Jmeter Load Testing
installing JMeter from SD

Locate the Apache JMeter certificate you copied to the SD card and click on it.

Apache Jmeter Load Testing - Locate the apache file
Apache file

You will need to enter the name of the certificate.

  • Click OK to confirm the installation of the certificate.
  • Go ahead to set up a screen lock password for security purposes.
Apache Jmeter Load Testing - Setting up a lock screen
Setting lock screen PIN

After all these configurations you can then run the test and capture the report making sure the Proxy is set to ON.

I hope you found this blog post Apache JMeter Load Testing: Test Mobile Apps on Windows Interesting and helpful. In case you have any questions do not hesitate to ask in the comment section.

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x