Describe the best practices to make data correlation simple in jmeter - jmeter

What's the best strategy when doing data correlation with jmeter? I have some ideas/questions, that go along these lines: usage of automatic correlation solutions (http://jmeter.512774.n5.nabble.com/automatic-correlation-for-jmeter-td5531399.html), usage of post processing extractors that best suite the need, for example regexp for http headers, xpath exp for HTML, if using xpath, get assistance by using Firebug or similar plugins, usage of xpath vs css&jquery, don't correlate data that isn't checked on the server, for example, if http referer is not controlled, it would be a waiste of time to correlate it, ... and such, but I would like to hear from more experienced people.

JMeter doesn't have autocorrelation. However you have tools like JCorrelate to accomplish the same. JMX Enhancers have some good tools that can help you cut your JMeter scripting time by 95%. Vist www.jmxenhancer.com for more details.
On the other hand, Blazemeter also have Smart JMX in their plugin which gives us autocorrelated scripts.

There is no auto-correlation for JMeter. HP Loadrunner has this functionality however it often fails.
XPath vs CSS/JQuery:
if your page has a very complex DOM and low number of styles - go for CSS
if DOM of your page is simple and styles number is high - go for XPath
If you simulating a real user using real browser - JMeter test should replicate it as close as possible, so make sure that you have:
HTTP Cookie Manager
HTTP Cache Manager
HTTP Header Manager
HTTP Request Defaults configured to:
Retrieve all embedded resources
Use concurrent pool of 2-5 threads for it
Filter out any external domains via "URLs must match" input

Related

Trying to Performance test an application developed in OJET technology. Which tool/protocol should I use for scripting?

Trying to Performance test an application developed in OJET technology. Which tool/protocol should I use for scripting? I tried HTTP/Web protocol with Jmeter and Load Runner. But that doesn't capture all the requests and responses at the javascript/browser level. Hence I am facing issues in correlating the dynamic values during test design. Hence, scripts fail during the replay. Currently trying to do it with Truclient Web protocol as an alternative. But I need to know which tool/protocol should I use for scripting?
According to OJET looks like this is a web app generator.
If you choose to start with JMeter use post-processor such as regex to catch and save every value that is needed for as arg in the next request.
Don't be afraid of these dynamic values. Try to follow next articles to get the idea.
None of tools will provide you automatic correlation without issue. Nor LoadRunner, nor Jmeter. It is always tricky.
Ask more specific questions when you start facing issue.
Jmeter catch correlations
You need to implement real user using your application with 100% accuracy in terms of network footprint
Both JMeter and/or LoadRunner are not capable of executing client-side JavaScript, the options are in:
Implement these JavaScript-driven network calls using scripting (in JMeter it will be JSR223 Test Elements)
Use a real browser, LoadRunner's Truclient protocol is basically a headless web browser, in JMeter can be integrated with Selenium browser automation framework via WebDriver Sampler
With regards to "which protocol/tool" to use:
Implementing JavaScript calls manually will take extra effort, however your test will consume less resources (CPU, RAM, etc.)
Using real browsers will take less efforts, but the test will consume much more resources (something like 1 CPU core and 2 GB of RAM per user/ browser instance) and you won't have metrics like Connect Time, Latency, etc.
LoadRunner TruClient. This will handle all of the Javascript executions and dynamic elements related to session, state, date/time, object identifiers, ... You will still need to appropriately handle user input items.

How to test client side performance testing of single page application with JMeter

JMeter does not support the client side performance testing (verifying the content rendering time / page loading time) out of the box.
In single page applications requests are sent to the server as API calls. I am interested in verifying the client side page loading time for concurrent users with JMeter.
What is the best way to test the SPA with JMeter ?
Do you recommend Selenium WebDriver plugin?
Is there any other tools that can be used to verify the client side
load testing for concurrent users?
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).
So I doubt whether it makes sense even to consider JMeter for pure frontend operation, most probably you're looking for Performance tab of your browser developer tools or more sophisticated solutions like Lighthouse or WebPageTest
With regards to WebDriver Sampler plugin, it just provides JMeter integration with Selenium browser automation framework so you will be able to launch a real browser per JMeter thread (virtual user) and the rest depends on your implementation, most probably you will want to query window.performance APIs values to get the metrics you're looking for via executeScript() function

Creating JMeter scripts for ServiceNow applications

I am wondering if anyone was able to successfully create JMeter scripts for ServiceNow applications?
My challenge is that there are way too many recorded HTTP requests and JSONs in POST requests & response are huge and extremely hard to correlate dynamic values.
Welcome to Web 2.0
I'm afraid you will have to perform the correlation as the times where you could just replay the recorded test has gone.
If you're looking for a way of reducing effort required for the correlation implementation you can consider trying out an automated correlation solution like:
JMX Enhancer
BlazeMeter Proxy Recorder with SmartJMX export option
Otherwise you will have to wait until it's implemented in JMeter

Load testing tools Symfony2 powered website that executes Javascript?

Most of the tools out there do not seem to be interpreting jQuery / Javascript code that is loaded on the page that I want to test. This is however important because that code will, in turn initiate a number of calls to other endpoints in my webapp which adds up to load in a real life scenario.
I've looked at JMeter already and am a bit reluctant to give it a try as the landing page mentions explicitly that it does not do Javascript interpreting at all.
What would be some recommendation of tools that can provide a more accurate measurement of load testing by including Javascript code?
None of the load testing tools really executes JavaScript, they all act on protocol level and JavaScript is being executed by browser.
There are 3 options how you could proceed if you want 100% realistic testing:
HP LoadRunner has TrueClient protocol which is basically headless browser with JavaScript capabilities.
JMeter with WebDriver Sampler plugin - the way to kick off real browsers from JMeter test
Selenium Grid (or other way to kick off several Selenium instances at once)
All 3 above options are very resource intensive, you will required at least 1 CPU core and a couple of gigabytes or RAM for a single browser instance so I would recommend a little bit different approach. JMeter cannot execute JavaScript, but it can execute JavaScript-driven HTTP Requests so create main load using JMeter (or equivalent) and while the load test is running use Selenium to automatically check real browsing experience or YSLow to do the same manually.
Load testing tools doesn't execute JavaScript.
You know which endpoints your JavaScript code is using so just add these endpoints to your JMeter scenario.
The thick client problem has been around since the early 1990s with traditional thick client-server applications. In fact, the earliest commercial tools were all driving full clients on X Windows before adding API level virtual user capabilities. On the commercial front this ability to drive full, thick clients is still expressed as GUI virtual users (Mercury/HP/Microfocus LoadRunner, Segue/Borland/Microfocus Silk Performer, Rational/IBM Performance Tester) allowing you to measure the weight between API and user level if needed.
Here is the thing, for a given business process and data set the end client is predictable in its behavior, and in the requests that it makes to the servers that are feeding it data. There may be a few odd conditions where you need to reproduce an algorithm from JavaScript to C (or even run it directly in some tools) for branching on a type of API/HTTP request, but these are not numerous.

Does JMeter end up testing the back-end of a web-application with the front-end as an entry point?

I'm told that we need to do some performance testing on one of our web-applications, so I'm trying to get some JMeter stuff to work, which as far as I know would simulate the HTTP GETS and POSTS. However, one of my colleagues is telling me that if I use it, it'd only accomplish FE testing. But, if I do this, it still is able to create items in the database and interact with the logic, so I figured it should be sufficient for performance testing of the back-end. Her reasoning is that "if it goes through http pages, we can’t tell which affects the performance".
So am I totally wrong? I'm confused.
The whole idea of the load testing thing is to simulate real-life users actions and behavior as close to reality as possible.
In JMeter terms that assumes presence and appropriate configuration of the following test elements:
HTTP Cookie Manager - to represent browser cookies and deal with cookie-based authentication
HTTP Header Manager - to represent browser headers like User-Agent, Accept-Encoding, Accept-Language, Content-Type, etc.
HTTP Cache Manager - browsers download embedded resources like scripts, styles, images, etc. but do it only once, on subsequent requests aforementioned entities are being returned from cache. To simulate this behavior you need to have HTTP Cache Manager
HTTP Request Samplers need to be configured to fetch embedded resources from the web pages and use a separate thread pool for this. See How to make JMeter behave more like a real browser guide for more details on how to configure realistic behavior.
So given JMeter test is good designed and implemented it is quite enough to test backend as well. If during load test you figure out that bottleneck is i.e. database, you may need to load-test the database separately, JMeter is capable of doing this as well, however I'm a strong believer that load testing should be done against environment as close to production as possible and should target the whole system rather than individual components.

Resources