Use JMeter HTTP Proxy to record HTTP request from not-a-browser client - jmeter

I have a client/server configuration.
In the client I have an application that talks to the server by http/https withou a browser being used.
I want to know how to configure client and jmeter to record the http requests being send from client to server
The client is a Windows 10 machine.

There can be several options:
Your application has dedicated proxy configuration. In this case just configure it to use JMeter as a proxy
Your application respects OS-level proxy settings. For Windows 10 hit "Win + S" and type "proxy". Perform proxy configuration at all available locations:
If everything goes well you should be able to record your application network activity using JMeter. Refer to How to Run Performance Tests of Desktop Applications Using JMeter for a little bit more detailed information and some troubleshooting steps.

Related

Multiple Parallel Websocket connections to SignalR hub in JMeter

We are trying to load test our login workflow, by simulating 50+ users logging into our front-end, via the API calls. As part of the login process, we make a websocket connection to a SignalR hub(Connect). We then send a call over the websocket connection to a custom endpoint in SignalR(Login), used to add some data to the Redis cache, then do some stuff which isn't important, then send a call to a different custom endpoint over the websocket connection(Logoff) and then Disconnect the websocket connection.
So my question is multi-part:
How do we create a websocket connection from within JMeter?
How do we make a call to a custom endpoint over the websocket connection in JMeter
How do we do this for multi users simulated to be running in parallel, so we can test the load? In other words, we need multiple websocket connections open / alive from JMeter so we can test the load.
Note: Please be aware, I'm asking this on behalf of the load tester/JMeter developer, but because they are new to Stack Overflow, and I understand the SignalR side, I've been asked to log it. I know zip about JMeter, so please handle me like a noob trying to help someone solve a frustrating but important problem.
JMeter per se doesn't support WebSockets, you will need a special plugin if you want to enable this functionality.
The most advanced, comprehensive and supported as of now is JMeter WebSocket Samplers by Peter Doornbosch, it can be installed using JMeter Plugins Manager
Once you install the plugin and restart JMeter you will see several new samplers which will allow to open connection, send request, read response, and close connection.
Unfortunately I cannot guide you further because I don't know the specifics of your application, just look into your browser developer tools or other sniffer tool and configure JMeter to send the same requests as your browser (or other application) does.
More information:
Test SignalR Performance with JMeter
JMeter WebSocket Samplers - A Practical Guide
samples directory contains several example test plans covering different scenarios

JMeter API Testing - Recording the Incoming Traffic

Using JMeter, the HTTP Request is hitting a URL with the port.
Eg : apitesting.com:8888/api/series/one
I have also added a HTTP Test Script Recorder in JMeter, where I can mention the port and domain.
How do I import the incoming traffic to JMeter using tcpreplay and JMeter Proxy for the above example.
Thanks for your help in Advance.
Have you read the FAQ?
Does tcpreplay support sending traffic to a server?
If by server you mean a daemon (Unix) or service (Windows) which listens on a port (a web or mail server would be common examples), then probably not. The biggest issue is that tcpreplay doesn't understand the state of common protocols like TCP. This means it is unable to synchronize Syn/Ack's to create valid TCP sessions.
So you have the following options:
Consider using Wireplay tool instead
Convert your .pcap file into JMeter .jmx script using BlazeMeter JMX Converter
In both cases be aware that you will get only a "skeleton" of the project, you won't be able to replay production traffic, all you will get would be a set of HTTP Request samplers, you will have to figure out the workload model on your own.
In JMeter you can add to your HTTP request a Post Processor Named Response Assertion, If you check the Ignore Status checkbox you will ignore response of the server so even if server is down it'll not fail test and continue.

Can we record desktop applications using JMeter

Could some one please help me on the below
Is it possible to record desktop applications using JMeter?
I just tried the following, but didn't work
File--->Template--->Create
Workbench--->Recording Script-->Start
Launched my application which is desktop and perform some actions
Workbench--->Recording Script-->Stop
When I expand Threadgroup--->Recording Controller-Nothing recorded
Where am I missing?
You miss one important step:
configure your desktop application to use proxy and provide host and port where JMeter is running (localhost and 8888 if they live on the same machine
Also be aware that:
JMeter can record only HTTP or HTTPS traffic, if your application uses other protocol - the calls will not be recorded. In that case you can consider The Grinder as an alternative, it comes with TCPProxy which is more low level therefore is cable to capture more protocols
If your application uses HTTPS protocol you will need an SSL certificate in order to decrypt and record the requests, you can configure your application to use JMeter's certificate or vice versa.
On MS Windows you may need to add a Loopback Adapter
See How to Run Performance Tests of Desktop Applications Using JMeter article for more details on simulating multiple desktop applications using JMeter
As help explains:
The recorder is implemented as an HTTP(S) proxy server. You need to set up your browser use the proxy for all HTTP and HTTPS requests.
Technically browser is also a desktop application, so to answer your first question, yes, you can record desktop applications using JMeter. However, just like browser, your desktop application must have an ability to connect to the internet via user-defined proxy. And also recorder will only record HTTP traffic from and to the application, it will not record client-only UI events, or traffic generated by any other protocols.
So to sum up:
Any desktop application can use JMeter recorder
But only if you can configure it to use JMeter recorder as a proxy
And only if your goal is to record HTTP traffic related to your desktop application, nothing else.

How to get a web server to send outbound http requests through local fiddler proxy?

I'm running a local web server written in Go and I can debug traffic going to it from my browser; but, I can't see the http request that it makes to external services.
Do I have to run some particular configuration of the web server in order to get the traffic to appear in fiddler? It is running as a background process.
Short answer: you can't...
...unless your web application is written to open a connection to a Proxy server and route requests through that connection (e.g. connect to a remote proxy, and then send requests through it).
Typically what developers do is just dump the Web Request/Response to a debug file to inspect during development (or to debug on a live server, by enabling it with a flag at runtime).
Fiddler is a "proxy" service/server. When you are using it normally to debug browser requests, your Browser is configured to connect to a Proxy server. That is, it will send all web requests through your fiddler's local server (I think it's localhost:8888 if i remember from my Windows days of using Fiddler) which in turn makes a connection to your local web server that you are debugging.
You can read more about Proxies at Wikipedia.
In that picture above, your local web server would be Alice. Meaning, Alice would need to be configured to connect to a proxy server and then make web requests through it.
EDIT:
(for the "I really need this" crowd)
If you really want to modify your web server to send requests through a proxy, there are a few Go packages already written to help you. GoProxy is one such package.

Desktop based application recording in jmeter

I have a desktop based(.exe) application used for trading of equities.
1.Developed in VB uses TCP/IP.
2.Uses a database server which is an another server which the exe sends requests on.
3.I want to get the entire response using jmeter for 50 users at a time.
I wanted to record the responses for the transactions.I have worked with web applications where we create Http proxy server and start it and the recording happenes from browser but in this case i cant use browser.
Please guide me how to record the responses in jmeter with .exe applications.
Thanks and Regards,
Kumar
JMeter HTTP(S) Test Script Recorder is capable of recording only HTTP or HTTPS traffic so if following conditions are met:
Your .exe application talks to server using HTTP
Your .exe application can be configured to use HTTP proxy or respects Windows global HTTP Proxy settings from registry (or configured in Internet Explorer)
the answer is "yes", you can use JMeter to record the traffic. See Load Testing Mobile Apps. But Made Easy. guide for details on how to do it.
If one of above conditions cannot be satisfied there are following options available:
If you still want to use JMeter there is a possibility to use a sniffer tool like Wireshark to capture requests and manually construct them using JMeter HTTP Request or TCP Sampler.
Consider switching to Grinder tool which offers TCP Proxy
Hope this helps.

Resources