in apache Jmeter load testing for android. i am not able to start test script recorder - android

I am facing some issues while configuring load testing for Android Mobile application.
Mainly I am blocked at test script recording stage, not able to proceed after completing the setup.
Here are the details of what have done so far, any pointers will help greatly.
Successfully setup JMeter on my machine.
Added Template - RECORDING to get a test plan with HTTP(S) Test Script Recorder
Set Port for Recording, set my mobile to use the same port
Installed Root CA Certificate (Installed same on mobile device as well)
Configured mobile phone by setting IP and PORT
Started Recording, I am blocked at this stage, not able to start recording.
Thanks in advance.
Successfully setup JMeter on my machine.
Added Template - RECORDING to get a test plan with HTTP(S) Test Script Recorder
Set Port for Recording, set my mobile to use the same port
Installed Root CA Certificate (Installed same on mobile device as well)
Configured mobile phone by setting IP and PORT

Related

Can't send HTTP requests to Localhost Backend from React Native Mobile App

First day of 2022~! Learning mobile app dev is giving headaches. It can't be this difficult to set up. I've already lost 6 hours. Please help!
Situation
My dev environment runs in Ubuntu via VMWare hosted on Windows 10. Within this environment I have:
a Node/express backend API running on localhost that works fine when tested with Postman/browser
a default react native app made and run via Expo. I test this app from my Android phone by reading the QR code Expo/metro provides, served via Tunnel
Desired Behaviour:
the React Native mobile app should be able to communicate with the backend API
Error:
Network Error
at node_modules/axios/lib/core/createError.js:15:17 in createError
at node_modules/axios/lib/adapters/xhr.js:114:22 in handleError
at node_modules/react-native/Libraries/Network/XMLHttpRequest.js:609:10 in setReadyState
at node_modules/react-native/Libraries/Network/XMLHttpRequest.js:396:6 in __didCompleteResponse
at node_modules/react-native/Libraries/vendor/emitter/_EventEmitter.js:135:10 in EventEmitter#emit
Axios Post Request from React Native (abbreviated)
axios.post('http://localhost:5000/user/login', some-data)
Attempted Resolutions
replaced 'localhost' with variations of 10.0.2.2 and 127*
connecting via Expos (LAN or local instead of tunnel) but could not connect (timeout error)
playing with Ubuntu ufw firewall settings (disable, allow port)
ignoring all together by installing Android Studio to emulate but was told my device does not support SVM or at-x hardware virtualization which lead me down another rabbit hole
use local ip like 192.xxx.xx.xx that will solve the issue localhost won't work
So I realize what I did wrong.
When I ran adb reverse I used the ports that were used in tutorials and stackfoverflow questions (because often times these are defaults). But you need to use the port where your backend API is listening to.
For anyone else stuck the complete guide is:
If your backend API is listening on 'localhost:5000'
and if your react native app is running via expo on Local (it will say Metro is listening on 127* in the terminal, or 10* if set to LAN)
Then in the API request replace localhost with the the IP listed in expo above (127 or 10)
And in the terminal 'adb reverse tcp:5000 tcp:5000'
In Summary:
adb reverse the port that your backend api is listening on
swap localhost for the ip listed by Metro in the terminal when you start react native with expo

Connection drops when using Packet Capture in Android

I am trying to analyze traffic for an app on Android and for some reason all connections, including the app to be analyzed stop working IF I leave packet capture running.
I've tried:
1. Turning off Wi-Fi and using LTE connection
2. Installed certificates, (CN=Packet Capture CA Certificate)
3. Status showing Installed to Trusted Credentials
What can I do to fix this issue?

recording mobile app in jmeter 4.0 on windows 10

I searched, but I could not find, so I answered here.
I wanna record mobile app traffic and request in JMeter but I always get "network error" in-app. When I start recording in Jmeter4.0, nothing happens. On Android device get "network error". I correctly installed ApacheJMeterTemporaryRootCA on my android machine and correctly configured proxy. Devices are in the same network WIFI and Android has proxy = laptop ip. I use Windows 10 and Jmeter4.0. When I used windows 8 or MacOS the problem did not exist but I get a new laptop with this system and I have no ideas where is the solution/answer for my case.
Please help.
It might be the case that port 8888 which is used by the HTTP(S) Test Script Recorder by default is blocked by the Windows Firewall, you might need to create an Inbound Rule allowing TCP traffic to port 8888.
Also make sure that Android device has port 8888 in its proxy settings.
Alternative solution could be using Cloud Based Proxy Service, it simplifies certificate installation procedure to a single click. As a bonus you can benefit from automatic correlation feature as the proxy is capable of detecting dynamic parameters and automatically creating Regular Expression Extractors to handle them

How to test Android app in JMeter?

I have come to know that Configuring android device to use JMeter's Proxy, it is possible to record mobile application network activity via JMeter HTTP(S) Test Script Recorder.
I have an android app and a Web Admin Panel. The app has a sync button. When I press the button, the app syncs with the web admin panel. Now, I want to test the sync process in JMeter. I want to test that after pressing the button, the request to sync is sent appropriately to the server and the server responses correctly. Is it possible to test this in JMeter? If yes, then how to do it?
You can record mobile application traffic with JMeter by following next steps:
In JMeter:
Set up JMeter proxy server. The fastest and the easiest way is to use JMeter Template feature. From JMeter main menu choose:
File -> Templates -> Recording -> Create
Expand "Workbench"
Click "HTTP(S) Test Script Recorder"
Click "Start"
Locate ApacheJMeterTemporaryRootCA.crt file in JMeter's "bin" folder
Transfer it to mobile device somehow (i.e. send by email) and install it
Disable cellular data on the mobile device and enable Wi-Fi
Configure mobile device to use machine running JMeter as a proxy (port number will be 8888)
References:
HTTP(S) Test Script Recorder
Apache JMeter Proxy Step by Step
Load Testing Mobile Apps. But Made Easy
How to change proxy settings in Android
N.B. On some Android operating system versions you won't be able to configure SSL proxy using external application like ProxyDroid
Yes, this is possible. As you mentioned you need to add test script recorder, then you should take port number from it (8080 by default). Also you can select you thread group inside target controller for more convenient using.
Then you need to configure proxy on your android device.
Settings.
Wifi
Long tap on wifi network that you are
connected
Modify network.
Advanced option
Proxy > Manual
Than input your host and port (from JMeter script recorder). And
Save
Press start button inside test script recorder and JMeter will listen to your device. NOTE! Device will have network connection only when Script recorder is started. So if you need to check single request, I recommend you to reach to this step without proxy, then configure it, start script recorder and record only this needed step. After you done with recording, press Stop button.
Do not forget to turn off your proxy on device.
JMeter records mobile application requests on HTTP(S) Script Recorder and it has features to prepare and run our mobile application performance test scripts. All we have to do is to configure JMeter and Mobile device. In JMeter, we can test both iOS and Android native applications.
Steps to Configure JMeter:
Go to apache-jmeter-3.1/bin folder and start the jmeter.bat (Batch) file.
Right click on “Test Plan” > Add > Threads User(s) > Thread Group.
Right click on “Thread Group” > Add > Logic Controller > Recording Controller.
Right click on “Thread Group” > Add > Listeners > View Results in Tree.
Add HTTP(s) Script Recorder to Workbench by selecting Workbench > Add > Non-Test Elements > HTTP(s) Script Recorder option.
Add Port value as 8080 and click “START” button in script recorder. The JMeter proxy will be started on localhost.
For more details you can see our Android Jmeter blog

unable to record the action performed in hybrid application on android device with jmeter

I configured everything correctly i.e my device wifi with jmeter proxy. i am using jmeter 2.12 but when I am launching my hybrid application on device , the Test recorder is not recording anything. Please suggest . I tried everything.

Categories

Resources