Internal Server Error in Jmeter Script - jmeter

I am trying to create Jmeter scripts for our PEGA application, but every time reply scripts fail due to the following issue.
Can anyone help?
Thread Name: Thread Group 1-1
Sample Start: 2016-08-12 08:38:58 IST
Load time: 604
Connect Time: 0
Latency: 603
Size in bytes: 4267
Headers size in bytes: 1774
Body size in bytes: 2493
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: 500
Response message: Internal Server Error
Response headers:
HTTP/1.1 500 Internal Server Error
Server: Apache-Coyote/1.1
Set-Cookie: Pega-RULES=H79D7E64B2C531F36AE825FC87DA355F5; Version=1; Comment="PegaRULES session tracking"; Path=/prweb

You most probably are missing either a header or a cookie.
I suggest you try to record traffic using JMeter Test Script Recorder so that you avoid any missing header.
See:
http://jmeter.apache.org/usermanual/component_reference.html#HTTP(S)_Test_Script_Recorder
http://jmeter.apache.org/usermanual/jmeter_proxy_step_by_step.pdf
This way you won't miss any header or cookie.
Then see what need to be variabilized using Post Processor and variables (${varName})

Related

{"Message":"An error has occurred."} exactly mean/error it is

When I have executed the JMeter load test script. I am getting "Response code: 500" and also response data
{"Message": "An error has occurred."}
I have tried with different Id's to pass the data.
Sampler Result:
Thread Name: Thread Group 1-1
Sample Start: 2019-05-11 17:45:32 IST
Load time: 36
Connect Time: 0
Latency: 36
Size in bytes: 358
Sent bytes:5783
Headers size in bytes: 322
Body size in bytes: 36
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: 500
Response message: Internal Server Error
HTTPSampleResult fields:
ContentType: application/json; charset=utf-8
DataEncoding: utf-8
Response data:
{"Message":"An error has occurred."}
Expected Result: Should place an order(such as e-commerce)
Actual Result: Unable to place an order.
The client application gets an HTTP status code of 500 with the message "Internal Server Error" as a response for API calls. The 500 Internal Server error could be caused by an error during the execution of any policy within Edge or by an error on the target/backend server.
The HTTP status code 500 is a generic error response. It means that the server encountered an unexpected condition that prevented it from fulfilling the request. This error is usually returned by the server when no other error code is suitable.
https://docs.apigee.com/api-platform/troubleshoot/runtime/500-internal-server-error-0
Normally, you request is malformed and have break some logic/validation or which is not served by the server due to some error.
What can be done?:-
Execute the request manually using browser to check if there is a problem in the server in serving your request.
Your http request is not correct. Check for correlation/mandatory dynamic parameters. Use any sniffing tool like fiddler to capture two request and compare them to get the dynamic parameters and see if you have correlated them or not.

jmeter showing error when HTTP request is made

I am totally new to JMeter, when I tried to test a website.
The test result was like this
Thread Name: Thread Group 1-1
Sample Start: 2018-06-19 10:18:49 IST
Load time: 0
Connect Time: 0
Latency: 0
Size in bytes: 1176
Sent bytes:0
Headers size in bytes: 0
Body size in bytes: 1176
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: Non HTTP response code: java.net.URISyntaxException
Response message: Non HTTP response message: Expected closing bracket for IPv6
What might be the issue?
Looks like improper HTTP Request sampler configuration, for instance you put some not supported character into "Server Name or IP" field. Well-behaved request should look like:
Another option is placing the full URL into "Path" field like
However the best option will be just recording your test scenario using JMeter's HTTP(S) Test Script Recorder, this way JMeter will generate appropriate HTTP Request samplers which you will be able to replay with increased number of threads. See Apache JMeter proxy Step-by-step guide for comprehensive instructions.
Alternatively you can use JMeter Chrome Extension - in this case you will not have to set up proxies and worry about SSL certificates.

Response message: Non HTTP response message: no protocol: Response code: Non HTTP response code: java.net.MalformedURLException

Try to execute a script using Jmeter 3.0.I am getting error for eg. If I applied load of 50 users, Ramp-up period 10, loop Count: 1
Thread Name: Thread Group 1-2
Sample Start: 1970-01-01 05:30:00 IST
Load time: 0
Connect Time: 0
Latency: 0
Size in bytes: 729
Headers size in bytes: 0
Body size in bytes: 729
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: Non HTTP response code: java.net.MalformedURLException
Response message: Non HTTP response message: no protocol:
Response headers:
HTTPSampleResult fields:
ContentType:
DataEncoding: null
Can anyone help me why this type of error is showing?
I tried few requests for the above URL in JMeter 3.2. It seems like there is no issue in the URL. Please make sure the configuration of HTTP sampler as shown below.
HTTP Sampler Configuration
You can use Redirect Automatically option also.
Output
Jmeter; how to solve the error 'Non HTTP response message: unknown protocol'
If it is an https protocol include it in the text box and if not, you can leave it blank.
Type the url of the page in the text box labelled server name.
You can include the path if there is, in the path text box.
See image in the link below;
https://i.stack.imgur.com/PPum7.png

PUT in JMeter 415 Unsupported Media Type

I'm new in Performance Tests, I started using JMeter and creating my own scripts. I am doing stress performance test on an API, until now POST, GET, PATCH all were working, but I stopped at PUT method. I need to send a file using PUT method, in POSTMAN is working (in body I am using file type with the selected file, in the header multipart/form-data).
I tried to put the file path in "Send files with the request", Parameter Name: file, MIME type: form-data, Content encoding: utf-8.
In the request it doesn't give me the file.
PUT http://10.111.30.12/api/tasks/2
PUT data:
[no cookies]
Request Headers:
Connection: keep-alive
X-AuthToken:
MjEzNUZFMEMxMzFEQTVBMUMxQzYxMDU0MjE0OEFFRTJDRjU0ODQ0QkRCNDUyQkQ0QTgxREU0M0Y5MDQwMTk1RDJGMEE2RDNERTIxNjFBRjE3MEQ0QTNFQzM1OTVBRjMyQUI0MkJFN0MwMjYxMkFDRTBFMTQyMzYyNjYwMkREMTU0RkMxQTlBMjJDOUJFQkMwRjEwNDdFOTEwNjgyRDAwMTVBOTlEQ0ExQ0FFQTBGQjA2MEVDRUNFQjgzOEQ1MTA4ODVGOUYxMDhBQUM0RTc5N0JDQTA2RkYyNjYxQURGODE3NUM0MDlFN0RENEM0MTc0Nzc4MzczRjNDQ0VDQzM3Q0Y2QzU4REE2ODg2QzAyNEE1MzY0QThDN0IwMjhEMjdE
Content-Type: multipart/form-data
Content-Length: 0
Host: 10.111.30.12
Proxy-Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.2.6 (java 1.5)"
The sampler result:
Thread Name: API Thread Group 1-1
Sample Start: 2015-09-21 15:33:53 EEST
Load time: 22
Connect Time: 0
Latency: 22
Size in bytes: 202
Headers size in bytes: 202
Body size in bytes: 0
Sample Count: 1
Error Count: 1
Response code: 415
Response message: Unsupported Media Type
Also tried to put the file in body data as: "file: C:\apache-jmeter-2.13\bin\API Performance Test\file.txt" but now I am getting 400 bad request.
Please if anyone got any idea on how to do this, tell me too.
Since you're testing an API my expectation is that you need to add a HTTP Header Manager to send Content-Type header with the value of application/json.
The best way to get to the bottom of the issue is using a sniffer tool like Wireshark to compare what's being sent by Postman and JMeter and make sure that there are no differences.

how to run the recorded jmeter test plan

Thread Name: Thread Group 1-1
Sample Start: 2015-01-12 12:11:16 IST
Load time: 0
Latency: 0
Size in bytes: 1080
Headers size in bytes: 0
Body size in bytes: 1080
Sample Count: 1
Error Count: 1
Response code: Non HTTP response code: java.net.URISyntaxException
Response message: Non HTTP response message: Expected closing bracket for IPv6 address at index 14: /
Response headers:
HTTPSampleResult fields:
ContentType:
DataEncoding: null
I am trying to execute the recorded JMeter test plan... but its showing the error as shown above. Can anyone help me how to sort it out??
Perhaps recording issue or something connected with i.e. clash with HTTP Request Defaults.
By the way, there is an option for recording JMeter scripts right from Google Chrome browser via JMeter Chrome Extension which doesn't require to worry about proxies, SSL certificates, cookies, excluding usual patterns from recording, etc. perhaps it may be easier to use.
Error is "Response code: Non HTTP response code: java.net.URISyntaxException"
This is means url is not getting passed correctly.
Solution is,
Remove http:// from your server/ip in your http request.
While running look at the request sent. it should be http://server and not http://http://server

Resources