Fetch html response is not full via gatling,why? - scala-gatling

I call a http request,The reponse is html,but gatling get the response is incomplete.What should I do
I think a part of I need that is gatling supported resources.It is under the tag 'table'.

The server may not be returning the complete response due to an error or a problem with the server-side code. In this case, you should check the server logs to see if there are any errors, and you should also check the HTTP response headers to see if there are any indications of what went wrong.
The HTTP request may be failing or being blocked by a firewall or other network security device. In this case, you should check the network logs to see if the request is being sent and received successfully, and you should also check any network security settings to ensure that the request is not being blocked.
The HTML response may not be well-formed or may be missing some elements, such as the 'table' element you mentioned. In this case, you should validate the HTML using a tool such as the W3C HTML Validator, and you should also check the HTML source to ensure that all required elements are present.

User issue, as concluded on the Gatling community forum.

Related

No "Location" header in JMeter for Auth 2.0

Auth 2.0.
"code" parameter is required to perform
POST /.../oauth2/v2.0/token
with code value.
In Fiddler code value could be found in Location header of response to /kmsi request:
However, here is no Location header in JMeter for the same request:
Why? Are there any tip to get Location header in JMeter too?
If you're seeing different response it means that
Either you're sending a different request. In this case inspect request details from JMeter and from the real browser using a 3rd-party sniffer tool like Fiddler or Burp, identify the inconsistencies and amend your JMeter configuration so it would send exactly the same request as the real browser does (apart from dynamic values which need to be correlated)
Or one of the previous requests fails somewhere somehow, JMeter automatically treats HTTP responses with status codes below 400 as successful, it might be the case they are not really successful, i.e. you're continuously hitting the login page (you can check it by inspecting response data tab of the View Results Tree listener). Try adding a Response Assertions to the HTTP Request samplers so there will be another layer of explicit checks of the response data, this way you will get confidence that JMeter is doing what it is supposed to be doing.

POST Request is Displaying as GET Request During Replay In Jmeter

I have a Jmeter script where during replay, Post request is displaying as Get request and the parameters in the request are not sent to the server. Due to this, correlations are failing at this request.
One of the parameters in the request is ViewState with so many characters. Is this large parameter value causing the above issue? How to proceed now?
Most probably you're sending a malformed request therefore instead of properly responding to a POST request you're being redirected somewhere (most probably to Login page)
Use View Results Tree listener in HTML or Browser mode to see what page you're hitting in the reality
With regards to the ViewState, "so many characters" is not a problem, the problem is that these are not random characters. ViewState is being used for client-side state management and if you fail to provide the proper value you won't be able to move further so you need to design your test as follows:
Open first page
Extract ViewState using a suitable Post-Processor
Open second page
here you need to pass viewstate from the step 1 along with other parameters
More information: ASP.NET Login Testing with JMeter
Also don't forget to add HTTP Cookie Manager to your Test Plan
What I'm able to understand is the request may be getting redirected. This happens usually when the server expects a unique request. If you recorded the request, you may be possibly using older headers that carry old cookie information. Check your headers and then reconstruct the request.
Make sure you are not using old cookies anywhere. remove that cookie part from HTTP Header Manager everywhere.

Using Gatlin load testing, how do requests get classified as "KO?"

I am using https://gatling.io for load testing an application. I really appreciate the default reporting from the tool. After searching the documentation, it's not clear to me how particular requests get classified as "KO." (or not ok)
We are currently using all the default settings from Gatlin.
We suspect that requests need to respond under 10 seconds from inspection of gatling.conf.
Is this assumption correct?
Anything that fails a check() will be a KO
Even if you haven't added a check yourself Gatling checks for an http 2xx or 3xx response by default
https://gatling.io/docs/2.3/http/http_check/
If you're seeing KO's and haven't added any checks it's likely you're getting some 4xx or 5xx responses

Logging in grinder

I am testing a webapp, i want to log all http request and response, how do i do that?
I am just writing
log = grinder.logger.info def page15(self):
"""GET COPSApp (request 1501)."""
result = request1501.GET('/webdynpro/call_agent_dtop-login_wd/COPSApp')
log("-----------------------------------")
return result
But it is not logging. what do i need to do in order to login
Thanks a lot
Request Logging
Grinder will normally log all of your HTTP requests. So at least for the request logging, the default behaviour may be good enough for you. Look for a log file with a name like
<hostname>-0.log
In this file, you'll see your requests, plus the server response codes.
If you want to explicitly log your http request from your code, you'll need to use a slightly different pattern than the one you are currently using.
request1501.setUrl('/webdynpro/call_agent_dtop-login_wd/COPSApp')
response1501=request1501.GET()
log(request1501.getUrl())
Response Logging
When logging the HTTP response, you need to deal with the body and the headers separately. Based on your code example above, you could log the body like this:
log(response1501.getText())
There are a couple of ways you can log the HTTP response headers. The easiest way would be to dump them all to the log in a single statement, like this:
log(response1501.toString())
To get an idea of the other options for logging http response headers, and the different things you can access separately, see the HTTPResponse API here:
http://grinder.sourceforge.net/g3/script-javadoc/HTTPClient/HTTPResponse.html
Login
In your question, you also asked "what do i need to do in order to login". I assume this is a typo, and that what you really mean is how do you write stuff to the log. To do an actual login, you need to submit a username and password, typically via HTTP post. Grinder can do this for you easily enough, but that topic should be addressed in a separate question.

HttpClient automatically retires before the response is received from server

I'm come upon a wierd problem with java HttpClient library.
Specifically the library automatically retries my request (POST requests)
even before the response is received from the server. Moreover the weirder problem
is that this only happens on specific hosts (machines).
So the end result is if a post request succeeds, then there may be an exact same
post request coming to the server which the server can't handle. Now, I do want
the retry behavior, but it should behave intuitively.
Anyone faced this kind of problem before, or is there a way to configure
http client to wait for a specific time before retrying. I'm not sure what going
wrong here.
Do you have a methodretryhandler set for your HttpClient? As in:
DefaultMethodRetryHandler retryhandler = new DefaultMethodRetryHandler(10, true);
client.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, retryhandler);
That is where retries would originate and you could debug and see what response headers it's receiving if any, etc.
Have you tried using a firefox http monitor or ethereal or similar to look through your http requests and responses and ensure that what you believe is happening is actually hapening?

Resources