JMeter & Salesforce : Facing an error as 'Error occurred while loading a Visualforce page. Attempt to de-reference a null object' - performance

I am creating script in JMeter for a Salesforce application but I am Facing an error as
Error occurred while loading a Visualforce page. Attempt to de-reference a null object' for one of my POST request.
Response code received is 500 with message 'Server Error'

HTTP Status 500 stands for Internal Server Error, you should look into your server logs in order to get to the bottom of the issue.
If you don't have access to your application logs - you can perform some client-side troubleshooting, the common way is to capture the request which is being sent by JMeter and the real browser using a sniffer tool like Wireshark or Fiddler and compare them. The requests should look exactly the same (apart from dynamic values which need to be correlated)
You should pay attention not only to the request body, but also HTTP Headers (including Cookies) as everything matters.
You might also want to check out JMeter – Logging Into Salesforce for Automated Testing article

Related

Azure Logic App - Get Response Body with 500 Internal Server Error

Is there any way to get the response body in Azure Logic App even when we get 500 Internal Server Error?
I have made the Logic App in a way that I'm setting the response code to 500 on an issue, and I'm adding some error related information in the response body. I tried returning 504 Gateway timeout as well, in case of a timeout issue I could face, but I'm always receiving a null response body in case of non-200 response codes.
If we are not able to see the response body in case of an error by design, is there a better way to set and fetch error related information from the response object?
Yes you can get the response body in Azure Logic App by adding the response action. According to this Add a Response action section of the Microsoft document.
When you use the Request trigger to handle inbound requests, you can model the response and send the payload results back to the caller by using the built-in Response action.
Following steps would help you to get the response body.
In the Logic App Designer, under the step where you want to add a Response action, select New step.
The under Choose an action, in the search box, enter response as your filter, and select the Response action.
Now add any values that are required for the response message. For the Body, you can select the trigger body output from the dynamic content list.
I would suggest to read the Receive and respond to inbound HTTPS requests in Azure Logic Apps document for more information.
Alternatively you can also create alerts whenever HTTP 500 errors occur in your App and use Application Insights to view it using Azure Monitor. I would also suggest to read this Handle errors and exceptions in Azure Logic Apps Microsoft document for more information.

Response code: 503 Response message: Service Unavailable

I have given two url in csv file and trying to load that in jmeter. I am getting 503 response code.
As per HTTP 503 status code description
The HyperText Transfer Protocol (HTTP) 503 Service Unavailable server error response code indicates that the server is not ready to handle the request.
Common causes are a server that is down for maintenance or that is overloaded. This response should be used for temporary conditions and the Retry-After HTTP header should, if possible, contain the estimated time for the recovery of the service.
Note: together with this response, a user-friendly page explaining the problem should be sent.
Caching-related headers that are sent along with this response should be taken care of, as a 503 status is often a temporary condition and responses shouldn't usually be cached.
So I can think of at least 3 possible issues:
Your server is really overloaded, you can try checking Response Data tab of the View Results Tree listener - if you're lucky - you will the the aforementioned "user-friendly page explaining the problem"
Your request is malformed and server is sending 503 response instead of 4xx which indicates client-side error. Double check what URL(s) you're trying to open by looking into Request tab of the View Results Tree listener and try to open it in the browser. If you're building the URL from parts (i.e. host, port, protocol, query string, etc.) - you might want to check if the values are correctly read from the CSV file using Debug Sampler
I fail to see HTTP Header Manager in your Test Plan, some servers check the client Headers, for example User-Agent or Accept and may report an error if the required header is missing (i.e. indicating that the browser is not supported)

Jmeter response-data giving "malformed request" error

I am doing performance testing of an e-commerce website.
After adding items to the cart it is going to the shipping page
and selecting the shipping address,after that it is proceeding for checkout
In the shipping page,it is giving the following error in the response data
{"status":400,"message":"Malformed request","additional_error":""}
Request is going POST and data as **JSON
How to resolve this error?
We don't know.
It is either a bug in your application or your HTTP Request you're sending with JMeter is really malformed and you need to fix it.
I would recommend capturing the same request to the shipping page originating from the real browser and JMeter using an external sniffer tool like Wireshark or Fiddler. The requests have to be exactly the same (apart from dynamic data which needs to be correlated). Given you send the same request you should receive the same response. Amend your request to 100% match what you see from the browser and the issue should go away.
In the 99% of cases REST requests are failing due to missing Content-Type header with the value of application/json or similar (sometimes charset has to be specified as well). You can add this (and other) headers using HTTP Header Manager

Jmeter - Internal server error 500 in jmeter response code

I have recorded script in jmeter V3.3 via IE browser and then done correlation. When I run this script, then it is receiving internal server error 500 in response, however it works fine manually in IE browser and also while recording this scenario, it does not occur.
I also cross verified Header manager with Request Headers in network IE F12 Developer tool and it is uptodate.
Sampler Request
Http Get Request
It is simply Get request. I really appreciate for your help to handle this error in jmeter.
I hope you have compared both Request Headers one from IE Browser and from JMETER request headers to check if anything is not missing to pass. And also along with any dynamic id is not missing.
You are likely not checking for expected results with each step. As a result, you are receiving an HTTP 200 correct response page prior to your HTTP 500, but the content of the page is out of context with the expected results for the business process. When you make your next request the state of the application is not appropriate to your request. As an unhandled condition by the developer you are greeted with an HTTP 500 screen dump.
Most likely cause: Unhandled dynamic data component.

JMeter error : java.net.SocketException: Unexpected end of file from server

I have read and tried the solutions shared in the previous posts for this error but nothing helped me to fix this. Kindly help.
I am making a HTTPS API call. A very simple call which accepts a 2 KB JSON message via POST method and sends a one word acknowledgement. It works perfectly fine in Postman tool. In JMeter, no. of threads (users) is kept as 25. It works perfectly fine one time with all 25 success response and at times getting few failure response as
Response code: Non HTTP response code: java.net.SocketException
Response message: Non HTTP response message: Unexpected end of file from server
No consistency at all. I have also tried with both enabling and disabling "use keepalive" checkbox. Both giving me all success one time ; few/all failure at another time with the above error. Please help. Thank you.
Below are the JMeter settings:
HTTP Header Manager : Content-Type - application/json
HTTPRequest sampler : protocol - HTTPS
Server Name or IP : project server name
Method : POST
PATH : The required path with https authentication details passed as parameters
IMPLEMENTATION : Set to JAVA (HTTPCLIENT4 was giving me “443 failed to respond” error)
Add header
Connection Keep-Alive
Both errors (Java implementation and Apache HTTPClient4 implementation), are essentially saying the same thing: The server closed the connection, without providing any response. I think there could be the following reasons:
Authentication problem. If server side checks authentication before processing a request (e.g. using Spring), it may be rejecting your request, it may be not bothering with any response if authentication is not considered correct.
Request Issue. Some less noticeable properties of the request you send via Jmeter are different from what you send in Postman. It could be some minor thing with formatting, or some headers server expects. Some of such inconsistencies can also cause Load Balancer (if you use one) to reject request before it's delivered to the server.
Certificate issues. Since you are using HTTPS, you need to make sure your certificate is setup correctly on JMeter side.
So I suggest:
Review server logs and see if your request makes it to the server. If yes, you might be able to see how it was rejected. If not, you need to trace back and see who rejected it (LB, authentication, etc)
Compare headers and body sent by JMeter vs Postman line to line (use TCPDump for example to obtain it).

Resources