Requests to payment a gateway are failed from JMeter on cloud systems - jmeter

I have a JMeter Test Plan (JMX) which simulates users placing orders and making credit card payments at the end.
The script works well when it runs from my machine. Requests to the payment gateway failed only when the script was executed from a third-party JMeter online service (e.g Redline13, Blazemeter, and Loadium).
The first request failed with the following error.
I have tried with several header configurations
Sending requests without any pre-defined headers
Setting user agent explicitly in Header Manager
Enabling Browser Compatible Headers in the HTTP Request
Also compared the requests generated from the third-party service provider and the requests generated from my machine. Also copied the headers and used them in the local machine.
It works well with the local machine but it continues to fail in the requests from the third-party services (Redline13, Blazemeter, and Loadium).
Any solution or direction is highly appreciated.

As per JMeter project main page:
JMeter is not a browser, it works at protocol level. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it's possible to view the response as HTML etc., but the timings are not included in any samples, and only one sample in one thread is ever displayed at a time).
so the message is quite expected.
The fact that the script works on your local machine and doesn't work in the cloud most probably means that the payment gateway (or its mock) is not reachable from the Internet.
You can increase JMeter logs verbosity for the HTTP protocol by adding the next line to log4j2.xml file (lives in "bin" folder of your JMeter installation)
<Logger name="org.apache.http" level="debug" />
and compare jmeter.log files from local and cloud runs, it will contain request and response details which you will be able to compare and figure out what's different.

Related

500 Internal Server Error In Load Testing By Jmeter for SAP application

I am writing load test script for an SAP-based application in jmeter. I am getting 500 internal Server.
I saw that the request looks same which I have on the browser network tab and the one I provided in JMeter. The only difference is in the request header, that I am not providing any SAP-passport in my request. I am not to see the SAP-Passport in the response of any previous request's response so that I can extract that and use in future requests.
Please tell me if I am assuming correctly that the SAP-Passport is the issue, if yes then how can I get that and use in the request. Also if there is a way to get any static SAP-Passport.
Its a blocker for me and its on priority, please help.
As far as I can see from Single Sign-On with SAP Passports article it is a matter of adding a client certificate to JMeter.
Obtain SAP Passport root certificate somehow (i.e. export it from your browser)
Add it to JMeter. This can be done in 2 ways:
Using SSL Manager
Using JMeter system.properties file
Check out How to Set Your JMeter Load Test to Use Client Side Certificates guide for comprehensive instructions on both approaches.

How to use JMeter to record user input

How to record user input parameters using JMeter? I tried to use the record controller and follow through the tutorials, all the records are only http get requests without any post input. Thanks
Properly configured JMeter captures all network activity between browser and application under test, the fact you don't see POST requests might indicate one of the following:
Browser simply doesn't make any POST requests, i.e. your application is designed to operate only GET HTTP Request types
Your JMeter configuration is not correct, i.e. your application uses HTTPS. In this case you need to perform some extra configuration so JMeter could intercept, decrypt and record HTTPS requests:
make sure your browser is configured to use proxy for all protocols
make sure you install JMeter's self-signed certificate to your browser. The file name is ApacheJMeterTemporaryRootCA.crt and it is being generated in "bin" folder of your JMeter installation when you start JMeter Proxy Server
More information:
HTTP(S) Test Script Recorder (pay attention to HTTPS recording and certificates chapter)
Recording HTTPS Traffic with JMeter's Proxy Server

What is the difference in testing file upload and download with FTP request and HTTP requests in Jmeter

which is the actual way to test performance of upload and download files using JMeter tool ?
HTTP and FTP protocol are totally different, if your application supports both - you need to load test both methods as they are handled differently on the server side. Your load test needs to simulate what real users are/will be doing so check your application requirements prior to building the test plan.
For simulating HTTP uploads and downloads you need to use HTTP Request sampler
For simulating FTP uploads and downloads - go for FTP Request sampler. FTP protocol provides some more ways of files and folders manipulation, i.e. moving, deleting, listing contents, etc. so you may also need to perform these operations using Apache Commons Net libraries and JSR223 Sampler, check out Load Testing FTP and SFTP Servers Using JMeter guide for comprehensive explanation and example code snippets

Can changing user agent to android in jmeter recorded test send traffic from android devices even if no emulator is installed in my laptop?

For load testing from different browser do we need to have all browser version on host machine or user agent change in existing script will work?
JMeter acts on protocol level, it builds HTTP requests using Java code and Apache HTTPClient libraries by default.
If application you're trying to test logic differs depending on browser you can mimic different browsers by sending the relevant User-Agent header via HTTP Header Manager.
Also consider the following settings:
configure your HTTP Request samplers to:
Retrieve all embedded resources
Use concurrent pool of 4-6 threads for this
This way you will be able to replicate browser behaviour when it comes to working with images, CSS files, JavaScript files, etc.
add HTTP Cache Manager to represent browser cache
add HTTP Cookie Manager to mimic simulate browser cookies, deal with cookie-based authentication, represent sessions, etc.
Check out How To Make JMeter Behave More Like A Real Browser guide for more detailed explanation of the above recommendations.
No.
A web-browser uses User-Agent to tell a server what kind of Browser and Operating System it uses. According to Wikipedia:
This allows the web site to customize content for the capabilities of a particular device
If you recorded your script with Chrome, JMeter would tell the server it was Chrome, and the server would respond to JMeter as if it were Chrome. JMeter, however, does not actually user Chrome in any way. Similarly, if you were to change you User-Agent to Android, the server would just respond to JMeter as if it were an Android device.

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