OpenbravoErp performance testing - performance

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.

Related

Can JMeter do automation testing like Selenium can do?

i am still new to JMeter and i was assigned to a work that I will need to use JMeter to perform automation testing. The idea is to write script using JMeter and run the script to fill in the forms in the website. I was curious that can JMeter use different data from the database to fill in the form of the website everytime it execute?(unique data for every user)
I have followed this tutorial (https://www.blazemeter.com/blog/fill-forms-and-submit-with-jmeter-made-easy/ ) and it succeed, however, when i try to change the parameter name (to some other names that do not matches the field name found in the inpect mode), it still works. So i was wondering how JMeter knows where to put in the parameter even i have change to a wrong field name?
As per JMeter Project main page:
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).
Browsers don't do any magic, they execute HTTP Requests, wait for response and render it. JMeter in its turn can execute the same HTTP requests so traffic would be the same, however it will not render the response, but rather measure the time and collect some more metrics.
If you change the names of the inputs in the form most probably the request will be successful, to wit you will get HTTP Status Code below 400 hence JMeter will mark the result as "green", however if you inspect the response using View Results Tree listener you will see that the form is not filled and/or you still at the same page.
If you want to use JMeter for checking the data returned by the application you're testing consider using JMeter Assertions to test presence of expected values, absence of errors, set response time thresholds, etc.
You can automate the form submission or order placement usin JMeter. You can JMeter for API testing as well by adding assertions. But the main purpose of the JMeter is to test the performance of the application. Its not like selenium which performs actions on the browser whereas JMeter sends the request in various protocols to relevant server and can also simulate many users at the same time.
If you want to do extensive automation testing,JMeter isnt the ideal tool for that.
You can use webdriver sampler to run the selenium with jmeter. It requires to configure sampler and browser config which are plugin and can be downloaded using plugin manager.
For more info:-https://www.blazemeter.com/blog/jmeter-webdriver-sampler/
Now, without the plugin it is working on protocol level and not on the frontend as pointed out in the above comments.
So, yes it can depend on which layer you want to work. It can work on frontend like selenium using the webdriver plugin and can submit the form with different data as a direct request to the server without using the frontend/GUI.
Hope this helps.
It depends on what you are trying to automate. If you plan to automate API invocation where there are some pre-requisites like grabbing tokens, cookies, session IDs from the browser, then JMeter can probably be used where existing JMeter capabilities can be leveraged using BeanShell scripting and other plugins.
But if you plan to have a full blown UI automation framework then JMeter might not be an ideal choice.

Unable to capture a correlate a value on a webpage using JMeter

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

Wait until option JMeter

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

What should be the value of "parallel download" field in HTTP sampler of 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.

jmeter regarding performance and load testing

Let me describe the issue which i have been facing.
i want to do performance and load testing on our internal website. which has login and other functionalities.
the issue i am facing that when i hit 12 or any number of request using http sampler then i am getting same response from all the 12 request. But actual scenario is that webpage displays different data for different page.
I checked using firebug and everything is working fine over there using correct response from request but when i use jmeter i am using same response from every request.
Please let me know if anybody had faced same kind of issue of is there anything i am doing wrong in configuring script.
Try to add HTTP Cookie Manager to your test-plan to the root (Test Plan) node or to the Thread Group node.
As per jmeter documentation:
The last element is a HTTP Cookie Manager. A Cookie Manager should be
added to all web tests - otherwise JMeter will ignore cookies. By
adding it at the Thread Group level, we ensure that all HTTP requests
will share the same cookies.
Ensure that parameters values that are dynamic are not hard-coded (after recording jmeter scripts, for example): no hard-coded JSessionID values in your HTTP requests, e.g..
Ensure you don't miss any necessary params in your HTTP requests.
JMeter does not process Javascript or applets embedded in HTML pages.
Your problem may be caused by this feature.
As per jmeter documentation:
JMeter does not process Javascript or applets embedded in HTML pages.
JMeter can download the relevant resources (some embedded resources
are downloaded automatically if the correct options are set), but it
does not process the HTML and execute any Javascript functions.
If the page uses Javascript to build up a URL or submit a form, you
can use the Proxy Recording facility to create the necessary sampler.
If this is not possible, then manual inspection of the code may be
needed to determine what the Javascript is doing.
I would also recommend your to look first into Jmeter reference before further scripting activities - this may prevent from some faults and frustration.
At least these:
Building a Test Plan
Elements of a Test Plan
Building a Web Test Plan
Building an Advanced Web Test Plan
Hope this helps.
I would suggest - Use Jmeter's Regular Expressions. You may be able to resolve this issue with RegEx. Post using regex, use 'View Results Tree' listener to check if you are getting apt response for each of your threads.
You can also analyze your results using Blazemeter's listener that gives you more insights into your test.

Resources