can someone tell why does this happens, I'm running a test and I have all these things coming out
jmeter
You're showing us your Test Plan (incomplete though) hence we cannot comment about "extra request" you're getting without seeing View Results Tree listener output
The most common reasons for "extra requests" are:
Redirects
Calls for retrieving Embedded Resources (images, scripts, styles, fonts, sounds)
Outcome of Logic Controllers like Loop or While Controller
Related
I am currently trying to record a webpage which includes bundled.js files which are used to build the webpage.
Tool: JMeter version 3.0
The issue is that when I record the page in JMeter and replay the page response does not include all the elements and therefore I am unable to correlate the values that I need to then pass to the next call.
What I have noticed is that if I attach a view results tree to the recorder the values that I am looking for are visible. So they are being captured during the record but not visible on the response when replaying.
I am thinking that the .js files are executed during page load and therefore not being captured and all it shows is the actual
Please help
JMeter does not run client-side JS code at all. JS code is used for rendering on client side, while recording (and replay) in JMeter is done on HTTP level (communication level between client and server). It's the same level you'd see on Net tab in Developer tools of the browser. As far as recording/replay are concerned, those file will only be downloaded, and the client to server traffic they produce will be replayed. But nothing that runs purely on client side will be replayed. So if some magic/logic happens on client side (e.g. calculations, data transformation, etc within JS, which then is sent to the server), you have 2 options:
Duplicate the same logic /dynamic data using JMeter scripting functionality before sending an HTTP request. This is what most commonly people do.
Or another option is to use Selenium sampler and duplicate UI-level behavior, but that type of testing is quite limiting and only fits certain cases
I wanted to know if JMeter has a option where you wait until some element disappears.
Example a loading bar only once that has completed or no longer visible then to carry on. (Also being able to monitor the length of time taken)
I have through about writing it as a webdriver test and then running it as a Junit test in JMeter but wanted to know if there is a simpler solution.
Any ideas welcome :)
First of all you need to realize that JMeter is not a browser
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 JMeter doesn't execute any client-side JavaScript, the only way of implementing "wait until" option is using While Controller in order to re-execute the same request again and again until response data will contain (or stop containing) the element you're looking for.
If you need to evaluate client-side JavaScript the only option would be going for Selenium. I would recommend using WebDriver Sampler instead of going for JUnit as this way you won't have to recompile your script for any change, it will be inlined into .jmx
You can use Transaction Controller to monitor the time taken by the whole process and to wait for a change , have a look at this:
http://www.sourcepole.ch/2011/1/4/waiting-for-a-page-change-in-jmeter
I hit a URL through my browser and and check the Network tab of the browser, it showed me like:
DOMContentLoad: 4 seconds (Just to load DOM)
Load: 7 seconds(DOM + scripts + assets)
When I hit the same through J-Meter, it gave me a response time of ~seconds.
So, through, J-meter it's taking very long time to respond. Then, I enabled "Parallel downloads" and added a value to number field under the advanced option of HttpSampler. The response time reduced.But, still I am not sure what should be the value of that number.
Can anyone please help me out here in understanding on what factor we decide the value of the number field.
Modern browsers use ~6 parallel threads for downloading embedded resources so you should put 6 there. Adjust the value up or down to mimic browser(s) you would like to simulate.
Also don't forget to add HTTP Cache Manager as read browsers download embedded resources only once, on subsequent requests the resources (images, scripts and styles) are being returned from the browser's cache so you need to mimic this behaviour as well.
And finally make sure you are excluding external domains (3rd party banners, counters, maps, whatever) to focus solely on your application calls.
See Web Testing with JMeter: How To Properly Handle Embedded Resources in HTML Responses for more details.
I only want to record and playback login page of openbravo,
problem is i don't know it is successfully playing back or not using VU(Jmeter).
How to know Virtual User(VU) is performing same like a real user ?
After #Dmitri T help i got following things
Why HTML is not parsed/how can parse it ?
I want Jmeter to mimic like real application ?
This might help you
You're half-way from your goal, all you need to do is:
Switch to "Response Data" tab
Select "HTML" or "HTML (download resources)" from the drop-down in order to see the rendered response
In order to make your test even more realistic:
Make sure that all your HTTP Requests have "Retrieve All Embedded Resources" box checked and you're using "concurrent pool" with the size of 3-5 threads as this is how real browsers act. The best way to configure it for all the samplers without having to change each request is using HTTP Request Defaults
Real browsers download embedded resources, like scripts, styles and images, but they do it only once. On subsequent requests these resources are being returned from the browser cache. In order to simulate this behavior you need to add HTTP Cache Manager.
I created an ASP.NET MVC4 Web API service (REST) with a single GET action. The action currently needs 11 input values, so rather than passing all of those values in the URL, I opted to encapsulate those values into a single class type and have it passed as Content-Body. When I test in Fiddler, I specify the verb as GET, and enter the JSON text in the "Request Body" input box. This works great!
The problem is when I attempt to perform Load Testing in Visual Studio 2010 Ultimate. I am able to specify the GET action and the JSON Content-Body just fine. But when I run the Load test, VS reports exceptions of type ProtocolViolationException (Cannot send a content-body with this verb-type) in the test results. The test executes in 1ms so I suspect the exceptions are causing the test to immediately abort. What can I do to avoid those exceptions? I'd prefer to not change my API to use URL arguments just to work-around the test tooling. If I should change the API for other reasons, let me know. Thanks!
I found it easier to put this answer rather than carry on the discussions.
Sending content with GET is not defined in RFC 2616 yet it has not been prohibited. So as far as the spec is concerned we are in a territory that we have to make our judgement.
GET is canonically used to get a resource. So you are retrieving this resource using this verb with the parameters you are sending. Since GET is both safe and idempotent, it is ideal for caching. Caching usually takes place based on the resource URI - and sometimes based on various headers. The point is cache implementations - AFAIK - would not use the GET content (and to be honest I have not seen any GET with content in real world). And it would not make sense to include the content in the key generation since it reduces the scalability of the caches.
If you have parameters to send, they must be in the URI since this is part of what defines that URI. As such, I strongly believe sending content with GET is wrong.
Even when you look at implementations such as OData, they put the criteria in the URI. I cannot imagine your (or any) applications requirements is beyond OData query requirements.