Record HTTPS requests of a mobile IOS/Android application with JMeter - performance

Is it possible to record httpS requests of a native app (IOS or Android) with JMeter? I tried some ways that I found but, I've not resolved the problem..

Use jmeter 3 with Java 7 or 8, it creates a crt file in jmeter/bin folder. It is the CA that creates the certificates.
Send this file by mail and open it in Android / iOS then install it.
In test script recorder, put in the dedicated field HTTPS domains , the domains you are trying to hit, see:
-http://jmeter.apache.org/usermanual/component_reference.html#HTTP(S)_Test_Script_Recorder
Restart Ipad/Android and jmeter test script recorder and try again.

to do this, you have to make your device trust the Jmeter Proxy CA.
So, you have to import the Jmeter CA certificate from
$JmeterHome/bin/ApacheJMeterTemporaryRootCA.crt
into the device.
I remember this is an area where things improved a lot recently, so be sure to have the last version installed.

Try deleting ApacheJMeterTemporaryRootCA.crt, JMeter's self-signed certificates have very limited life time (I recall something like 1 week), so if your certificate is older you might have problems installing it into browsers and/or mobile devices or it won't decrypt SSL traffic. The file will be re-created next time you start HTTP(S) Test Script Recorder
There is an alternative way of recording the mobile traffic by using your personal cloud proxy. Moreover, it will perform automatic correlation for you so you won't have to worry not only about SSL certificates, but also about Regular Expression extractor, JMeter Variables, etc. Check out How to Cut Your JMeter Scripting Time by 80% article for details.
If none of the above helps, take the following troubleshooting steps:
Add View Results Tree listener as a child of the HTTP(S) Test Script Recorder. In case of any problems with the recording a request it should display the error details.
Check your mobile device logs during failed certificate installation attempt. You may need to install Android and iOS developer tools for this.
Make sure that your application is really uses HTTP or HTTPS protocols as JMeter supports only these 2.

Related

How to record native iOS app requests in Jmeter?

I have tried recording native iOS app ( developed in Swift and Objective C++ ) in Jmeter using proxy but it didn't worked .
I also tried recording native app ( removing SSL from app ) but it didn't worked either.
For recording HTTPS traffic you need to install JMeter's self-signed certificate onto your mobile device. The file is called ApacheJMeterTemporaryRootCA.crt and you need to pass it somehow to your iOS device (send by email, upload to a web server and open it in your browser, etc.)
The file is being generated under "bin" folder of your JMeter installation when you start HTTP(S) Test Script Recorder
Additionally you will need to switch on "ENABLE FULL TRUST FOR ROOT CERTIFICATES", the setting lives under Settings -> General -> About -> Certificate Trust Settings
Be informed that the certificate has limited life span (7 days by default) so if you imported it a while ago you will need to reinstall the "fresh" version.
Also make sure to turn off the cellular data and configure Wi-Fi adapter to use JMeter as the proxy, given you start the proxy and properly configure your device to use it you should be able to capture HTTP traffic without any extra setup and HTTPS traffic if you have the JMeter's certificate installed.
All the traffic which is not HTTP or HTTPS will not be captured/recorded
More information: Load Testing Mobile Apps Made Easy

Jmeter Script recording not recording

The recorded the script and it was working on windows 7 machine. But now the script is not getting executed correctly in windows 10. The result is passed but aftual executions is not taking place. Also I tried to record new script on windows 10 but the script is not getting recorded. I am using the latest jmeter version. Could you please help me.
Jmeter should work fine on windows 10.
Cross check if you are able to access application (with or without proxy). If application is accessible through proxy, you need to open jmeter with proxy command.
Ensure you imported jmeter root certificate in browser.
You need to import JMeter's self-signed certificate into your browser. The file is called ApacheJMeterTemporaryRootCA.crt and it's being created in "bin" folder of your JMeter installation when you start HTTP(S) Test Script Recorder.
Check HTTPS recording and certificates chapter of the above article for the exact steps of certificate installation for different browsers.
Mozilla Firefox and derivatives have their own certificate storage, other browsers use Windows certificate storage, you can inspect it using Certificate Management Tool
If JMeter's certificate is not there - you will need to install it.
Be aware that there is an easier way of recording a JMeter test which doesn't require configuring proxies or installing certificates: JMeter Chrome Extension, just install it, start recording and perform your scenario steps in browser

Unable to test mobile application using Test Script Recorder

I am trying to test mobile application using jmeter Test Script Recorder but When i set proxy in my mobile and then I tried to captured, It shows all the time "No internet connection". I have set correct ip and port number.
Can anyone help me ?
There is more than one mobile operating system and troubleshooting options differ depending on vendor and OS.
Double check that you actually started HTTP(S) Test Script Recorder and there are no modal dialogs with warnings/errors and nothing suspicious in jmeter.log file
JMeter itself must have internet connectivity, if your machine is behind the corporate proxy - you will need to apply some extra configuration
Check if you can record anything using web browser on mobile device. Start with HTTP-based simple site i.e. http://example.com
If your application is using HTTPS protocol you will need to install JMeter's self-signed certificate onto the device, the file is called ApacheJMeterTemporaryRootCA.crt and it's being generated in "bin" folder of your JMeter installation when you start HTTP(S) Test Script Recorder and you need to transfer it to your device somehow (bluetooth, email, whatever) and follow your OS dialog to get it installed and trusted
For certain Android versions you might need to use a 3rd-party tool like ProxyDroid in order to proxy HTTPS traffic
For iOS devices you will need to "tell" that you trust JMeter's certificate under Settings -> General -> About -> Certificate Trust Settings
See the following materials for more information:
HTTP(S) Test Script Recorder user manual entry (pay attention to HTTPS recording and certificates chapter)
Apache JMeter proxy Step-by-step
You can consider using a cloud-based proxy service, in this case you will not have to worry about certificates generation and installation and will have confidence that the device will have Internet connectivity. As a bonus you will have possibility to export recorded script in "SmartJMX" mode with automatic detection and correlation of any dynamic parameters.

How to record native mobile app for load testing?

The application I want to load test is a Shopping Cart application(Server performance). I have tried with Jmeter for a purchase scenario, But the problem is Jmeter not recording actions like logins, selection from dropdown etc. Because of that on playback the recorded scripts won't create any user sessions and no purchase is happening. But Jmeter shows all the scripts were run successfully. I want to record each and every action on mobile. Is any solution for this problem? Do i need to use any other tool other than Jmeter? Please help.
Thanks in advance.
If your application makes a HTTP (or HTTPS) requests - JMeter can record it (assuming correct configuration)
Given you are able to record some requests it seems like you're almost there, few points to consider:
In order to make JMeter capable of decrypting and recording HTTPS traffic you need to install JMeter's self-signed certificate onto mobile device.
Start JMeter's HTTP(S) Test Scipt Recorder
Locate ApacheJMeterTemporaryRootCA.crt file under JMeter's bin folder
Transfer it somehow to mobile device (i.e. send it as an attachment to yourself and open the email on the mobile device)
Click on the certificate in the email attachment and follow your mobile OS dialog to get it installed
Make sure the certificate is up-to-date (it has limited lifetime, only 7 days by default) so you will need to re-generate it and reimport each week or amend proxy.cert.validity JMeter property to override the certificate validity period and make it longer
JMeter has a proxy server which can record all the HTTP/HTTPS records.
This site has step by step instructions.
http://www.testautomationguru.com/jmeter-record-ios-application-http-requests/

Record native mobile app with Jmeter

I am trying to record mobile app with Jmeter, the app has URLs with https,
I am using jmeter 3.1 and configured mobile and machine such that I am able to record URL(both http and HTTPS) and app from mobile in jmeter. Now I have an application, with the same configuration I have tried recording that app, but not able to record anything and the strange thing is that when I am trying to login into the app with proxy in mobile it's says "Unable to connect to server", but without proxy it's logining successfully. Does someone come across this situation. Please let me know if there could be any solution for this.
Unable to connect to server has many faces, going forward include more details into the question, i.e. mobile operating system, proxy configuration details, etc.
In the meantime here is a checklist:
JMeter can record only HTTP and/or HTTPS, other protocols are not supported
You need to configure mobile device to use the host running JMeter as a proxy for both HTTP and HTTPS protocols. For certain operating systems you may need 3rd party software, i.e ProxyDroid in order to setup HTTPS proxy
In case of HTTPS traffic you will need to install JMete's self-signed certificate - ApacheJMeterTemporaryRootCA.crt onto your mobile device. If did it already - be informed that JMeter certificates has limited life span (4 months or something like that) so you need to periodically "refresh" them. The fastest and the easiest way of installing the certificate is sending the aforementioned file to yourself via email and opening the attachment using the mobile device.
See HTTPS recording and certificates chapter of the HTTP(S) Test Script Recorder JMeter User Manual entry for more details.
You can also View the Webcast: Performance Testing for Native Mobile Apps to learn about alternative ways of recording mobile traffic and converting it into a JMeter test.

Resources