Performance Testing Between JMeter and LoadRunner - performance

Some URL response in LoadRunner is not included in JMeter Performance Tool.
Is there a way to add to missing URL responses in JMeter to simulate the same scenario for both tools?

It depends on your JMeter configuration. Most probably you didn't check "Retrieve All Embedded Resources" box on the "Advanced" tab of your HTTP Request sampler
If you provide only URL - JMeter will execute the corresponding HTTP Request to that endpoint, however it won't download so called "embedded resources":
JavaScript files
Styles (.css files)
Images
If this is the difference - you can quickly amend JMeter's behavior using HTTP Request Defaults.

Related

Is it possible to pass Keys.TAB or Keys.Slash using Jmeter through groovy script?

Is it possible to pass Keys.TAB or Keys.Slash using Jmeter HTTP request through a groovy script?
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 if pressing tab or slash triggers a network request to your server - you can mimic it by sending the corresponding HTTP Request via HTTP Request sampler. You can check whether pressing a key generates network activity by looking at "Network" tab of your browser developer tools
If pressing a key doesn't generate a HTTP request - you won't be able to test this scenario using JMeter, you will need a real browser driven by the browser automation framework like Selenium. JMeter can be integrated with Selenium via WebDriver Sampler

gets 404 error while runing SOAP UI in jmeter

Im trying to execute soapUI script in Jmeter but i am getting response as 404 in sampler result and Response Body is empty.
I have added SOAPAction and content type as well in header manager.
Can anyone please suggest.
Soap uses POST not GET HTTP method.
Ensure you add a Header Manager with correct SOAPAction header.
Use SOAP UI to generate the call from WSDL this will give you:
the URL
the Request Body
the correct headers
Alternatively, what you can do to be sure to send same data as SoapUI is to use JMeter Recording template, and put JMeter as a proxy of SoapUI then call WS from SoapUI, this will be recorded by JMeter
HTTP Status 404 means Not Found which basically indicates that you're hitting the wrong URL in JMeter.
Switch to "Raw" mode in the SoapUI and you will be able to see the correct URL and headers you will need to supply:
Also be aware that you can just record the request(s) from SoapUI using JMeter's HTTP(S) Test Script Recorder
Prepare JMeter for recording, the fastest and easiest way is using JMeter Templates Feature
from JMeter's main menu choose File -> Templates -> Recording and click "Create"
Expand HTTP(S) Test Script Recorder and click "Start"
Prepare SoapUI for recording
from SoapUI main menu choose File -> Preferences -> Proxy
configure it to match the JMeter settings
click "Proxy" button in SoapUI main toolbar
More information: Apache JMeter HTTP(S) Test Script Recorder

Jmeter Report:-How to download response parallel like browser jmeter shows by adding all sub url responses

Jmeter Report: How to download response parallel like browser? Suppose i have 4 request in one transaction controller and i want to get response parallel for all request instead of sequentially.
In my transaction controller 4-5 http request are present and i want to download response of all request parallel instead of sequential.
In report all response are added and then showing but when we are using browser response are showing by subtracting the depended or complete responses.
If you're talking about "embedded resources" - images, scripts, styles, fonts, etc. - you should not be adding requests for them manually, instead you need to configure HTTP Request Samplers to do this for you (or even better HTTP Request Defaults). The relevant settings live under "Advanced" tab:
If the nature of the requests is different, i.e. they're AJAX requests which are not supported by JMeter out of the box the easiest way of executing them at the same moment is placing them under the Parallel Controller. It is not a part of JMeter distribution bundle and can be installed using JMeter Plugins Manager

Javascripts in jMeter response of SPA

I am doing automation using API testing for mobile app.
There are 3 different home screens on app.
Workflow-
1)Login- Sending login API request & in response getting access token which is used in further requests.
2) Screen1-Sending API request on screen1 & getting response -Success
3) Screen2 -sending API request on screen2 & but its not working .It sends 3-4 .js(javascripts) files in response. Screen2 is Single page application. Jmeter does not execute those js from response hence no content seen.
I am blocked here & cant proceed .Any pointer ...appreciated.
First of all check whether JMeter is configured to download embedded resources. You can do it on "Advanced" tab of the HTTP Request sampler (or better HTTP Request Defaults)
If this box is unchecked - JMeter will return only main content but will not process any so called "embedded resources": images, fonts, scripts, styles which are referenced by the webpage.
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
So if there is a JavaScript somewhere in the response which triggers an AJAX request which returns your "js" files - JMeter won't execute it automatically, you will need to add a separate HTTP Request sampler(s) to mimic the AJAX call(s)
None of the load testing tools is capable of executing JavaScript so if you looking for a one - you need to consider real browsers. For example check out JMeter integration with Selenium via WebDriver Sampler, but be aware that this approach is very resource intensive.

How to execute Ajax requests in JMeter?

I want to execute Ajax requests in JMeter. I record my test plan with JMeter and BlazeMeter but none can handle Ajax requests. How can I solve my problem?
Or is there any tool that can send concurrent Ajax requests?
Thanks in advance,
M.A
By default, Ajax requests can't be simulated by JMeter as it does not process .js files (As of 3.1 version). You have to explicitly add the requests (HTTP Samplers) for AJAX requests.
Use Network tab of a browser (F12 option) and filter the traffic by xhr, which shows only AJAX requests. Add those requests as HTTP Samplers in the script at the point you needed in the Test Plan.
Browser can process .js files, hence AJAX requests are sent from the browser. When you record the script using HTTP Test Script Recorder, as you are using the browser to navigate, even AJAX requests (originated from js files) will also be added/recorded to the Test Plan.
Since JMeter can't process .js files due to limitation, manually add the AJAX requests (nothing but HTTP Get or Post requests) using HTTP Sampler, if you are building the Test Plan without HTTP Test Script Recorder.
Note: If you are using HTTP Test Script Recorder, no need to add them manually as they are already recorded in the Test Plan.
you can do that by recording http traffic with JMeter Proxy
http://jmeter.apache.org/usermanual/jmeter_proxy_step_by_step.pdf
but it is only possible to replay the same traffic, can be problematic for sessions, cookies...
Better solution is to use WebDriver
https://jmeter-plugins.org/wiki/WebDriverTutorial/
https://jmeter-plugins.org/wiki/PluginInstall/
the needed package is https://jmeter-plugins.org/files/packages/jpgc-webdriver-1.4.0.zip
It is not possible as kicking off more threads than originally defined in the Thread Group is not currently supported, the feature is being tracked as Bug 53159. AJAX requests are "normal" HTTP Requests so JMeter can record and replay them, but when it comes to asynchronous execution - you cannot do this as of now. The workaround options are in:
Use WebDriver Sampler plugin so each JMeter virtual user will kick off a real browser. Warning: this way is very resource intensive.
Use scripting, i.e. JSR223 PostProcessor to kick off AJAX-driven requests via Apache HttpComponents
Develop your custom sampler. You can use the current way of handling embedded resources as a reference.
Learn more: How to Load Test AJAX/XHR Enabled Sites With JMeter
I had this same problem after recording samplers using the JMeter Proxy. The answer was on this blog post: https://lincolnloop.com/blog/load-testing-jmeter-part-1-getting-started/ - see the Ajax Requests section.
Add an HTTP Header Manager for the ajax request and make sure you are sending the X-Requested-With:XMLHttpRequest header.

Resources