1

I am testing my native mobile app with JMeter; for that, I am using IP on my PC to my Android phone where my app is. Then I record the whole script and play it in JMeter. I have installed all the certificates.

But after changing the proxy on mobile to Manual and giving the proxy hostname as My PC's IP, it still is not working.

1
  • Sorry I have the same problem, which IP to use as proxy IP in the mobile ? I used my laptop's ip where jmeter is installed and recording but it did not work Jun 11, 2020 at 10:20

1 Answer 1

1

It is hard to tell what's wrong without seeing your JMeter, network and Android configuration, the "good" steps are:

  1. Make sure the host running JMeter and Android device are on the same subnet
  2. Make sure that cellular data is disabled
  3. Make sure firewall is not blocking incoming connections to port 8888
  4. Start JMeter's proxy:

  5. Configure your Android device to use the PC running JMeter as a proxy (use IP address as proxy host and 8888 as proxy port)
  6. If your application is using HTTPS traffic:

    • install ApacheJMeterTemporaryRootCA.crt certificate onto Android device. Make sure you have "fresh" certificate as it has limited lifetime (7 days), if the certificate is older - just delete it and restart JMeter's HTTP(S) Test Script Recorder - it will generate a new one
    • Depending on your Android vendor/version you might have to use a 3rd-party tool like ProxyDroid in order to send HTTPS traffic via proxy
  7. If above steps won't help (unlikely thought) be aware that there is an alternative way of recording native mobile applications network events. As a bonus you will get automated correlation of any dynamic parameters. See How to Cut Your JMeter Scripting Time by 80% article for details.

7
  • Thank you so much for the quick reply I have done all the things which you have told except One My android device(0.0.0.0) and my PC (255.255.255.0) are on the different Subnets I have searched entire net but didn't found how to make those on the same Subnet May 16, 2017 at 5:54
  • and one more question I have it may interest you When I am recording my script in GUI mode , Can I run that script in Non-GUI , as this is testing for Native Application not any web-application May 16, 2017 at 6:02
  • 1. For putting both devices under the same subnet - make sure you switch "IP Settings" from "DHCP" to "Static", after that you will be able to manually specify IP address and network mask 2. For running tests in non-GUI mode: definitely yes, moreover this is the recommended way of executing a JMeter test as GUI is very resource intensive. See How Do I Run JMeter in Non-GUI Mode? for details.
    – Dmitri T
    May 16, 2017 at 7:47
  • 1. Put mine PC's IP in Proxy Host name for android and port be the same as on Jmeter 2. Changed from DHCP to Static and put the IP as the IP of my Computer and default gateway seen on my command prompt But still the net doesn't work so will not be able to load scripts. any suggestions on this. May 16, 2017 at 8:48
  • Don't put IP of your computer as IP of your Android device, duplicate IPs are not allowed, one of them will not work, choose a free IP address from the same subnet and assign that IP to the Android device
    – Dmitri T
    May 16, 2017 at 8:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.