services working fine on rest client but not on Jmeter - jmeter

I am performing load testing of my web based application.
The service page is working fine on Advance Rest Client application but it is giving 404 page not found error on Jmeter.
Please guide me how to resolve.

404 means your url is probably wrong.
Show your configuration of Test plan for further details.

Add View Results Tree listener to inspect request and response details, HTTP 404 response code usually stands for non-existent URL.
Most likely you'll also have to add HTTP Header Manager to send the relevant Content-Type header as your request might not be properly handled due to missing or incorrect content type.
I would recommend using a sniffer tool like Wireshark to compare what's being send by the "Advance Rest Client" and by JMeter and tweak JMeter test accordingly. If you fail to figure that out by yourself - you can upload captured traffic files somewhere so we could take a look.
See Testing SOAP/REST Web Services Using JMeter guide for baseline JMeter configuration for testing web services.

Related

"/Error?aspxerrorpath=/Home/Index" I am getting this every time I run my jmeter script

I run my script and this **********.com/Error?aspxerrorpath=/Home/Index redirecting to this url in jmeter in request section of my jmeter and showing 500 error. I am not able to get the proper url redirecting to the errorpath page and also showing the error if I uncheck the follow request in repond it is showing the same url
Most probably your login request fails somewhere somehow therefore redirect to /Home/Index page fails as you're not authorized to see it.
Use View Results Tree listener to see request and response details and cross check them with what you see in your browser developer tools - the requests should be exactly the same (apart from dynamic parameters which need to be correlated)
Once you amend your JMeter configuration so JMeter would send the same requests as the real browser does your script should start working as expected.
You may find ASP.NET Login Testing with JMeter guide useful, it gives a real-life example of handling the specifics of ASP.NET applications load testing in JMeter

Load Testing in Struts2 Application - JMeter

I am trying to do a load test using JMeter for the first Time.
My approach is to test each page one by one.
The main page is like http://localhost:8180/myapp/login.do?actionType=login(I hardcoded the credentials)
I am able to reach this page without any problem.
I created a HTTP request component and able to see the response without any issue.
In the main page there is a button which populates the report, in the browser , the url is like
http://localhost:8180/myapp/mainmenu.do
But when i create a HTTP request it is reaching but shows the security error page in the 'Response
Data' as Due to security reasons, we still recommend you to close this window.
can someone guide me how to test the other pages without these security errors. This is a struts2 Web application.
No matter what technology is being used under the hood of the web application you're testing you should stick to one simple rule:
Well-behaved JMeter test must send exactly the same requests as real browser
It includes:
Same number/sequence/nature of the HTTP Requests
Same HTTP Headers (including Cookies)
any dynamic values need to be properly correlated
Once JMeter will send the same requests as real browser does it should receive the same responses. So just use a 3rd-party sniffer tool like Fiddler or Wireshark to capture the requests originating from browser and JMeter and amend JMeter's configuration until the requests start looking exactly the same. This should resolve your issue.
Solved the issue by adding HTTP Cookie Manger and
set Cookie Policy as Standard
click HTTP Cookie Manager
and click save icon on the top.
Source
https://jmeter.apache.org/usermanual/build-web-test-plan.html#adding_cookie_support
Thanks #Dimitri T and #Roman C for their valuable suggestion.

"Post" method test result error in JMeter API testing

I tried to run a POST method for API testing in JMeter, I have sent the parameters as needed, but still it shows cannot post.
What should I do to make it work?
user add post request
response message
If you are testing an API my expectation is that you need to send either JSON or XML payload using "Body Data" tab of the HTTP Request sampler.
You will also need HTTP Header Manager to send the relevant Content-Type header
References:
Building a SOAP WebService Test Plan
REST API Testing - How to Do it Right
Another way of building a web service test plan is executing the request(s) according to your test scenario using a 3rd-party tool like Postman or SoapUI and recording them via JMeter's HTTP(S) Test Script Recorder.
In the post request, you need to provide server name or IP address and port number respectively. If it still doesn't work, try changing the path by adding /api then /user/data. it works in some cases.
Hope this works out!

How to do correlation on dynamic parameter that are occuring in request and not in response in JMETER?

I am developing a mobile script using jMeter. i.e trying to record and replay mobile web applications using JMeter 2.9 and firefox 43.0.4
I am able to record the application. But it throws an error during replay, as some dynamic parameter is passed with the post data as below:
POST data:
skin=&skinLoaderChecksum=&isAjaxRequest=true&**x=****0.7379947959390617**
When I checked the same flow in Load Runner, the same failure occurs on the same URL again.
In Load Runner:
HTTP Status-Code=500 (Internal Server Error) and {"errorCode":"UNEXPECTED_ERROR","errorMsg":"FWLSE0009W: User identity is null. Check your application''s authentication requirements. These settings must match to the deployed application [project mobile]"}
In JMeter:
Response headers:HTTP/1.1 401 Unauthorized in Sampler Result and in response data: /-secure- {"challenges":{"wl_antiXSRFRealm":{"WL-Instance-Id":"geqcaecehouktkfn0rfqmmdu6"}}}/
Is anyone able to help with this?
Responses will be highly appreciated :-).
I don't have Worklight server to play with now hence I can provide you only generic information. You need to properly simulate mobile application authentication flow, actually this dynamic parameter can be fetched from the previous response.
Reference links:
How to do Worklight Server performance testing
How to Load Test CSRF-Protected Web Sites

Getting Internal server error for partcular request in jmeter

I am getting Internal server error in jmeter for particular request but same url its working fine in browser,even i handled the cookie in the script and checked web traffic in fiddler and header manager everything is correct but still its showing internal server error.
Perhaps you need to configure some HTTP header in your request to make it work. Your browser is inserting them as default, but for JMeter you need to do it manually.
Using a recording tool might help on the specifics, but even though you will need some changes on your test script.
I recommend BlazeMeter Chrome Plugin, it will insert any necessary HTTP headers for you based on the browser of choice.
https://chrome.google.com/webstore/detail/blazemeter-the-load-testi/mbopgmdnpcbohhpnfglgohlbhfongabi
Your site might require Cookies, therefore you need to use a Cookie Manager for that. In order to Test the requests, use the Listeners "Response Assert" or "Save Responses to a File" to check if the response was sent properly.

Resources