JMeter embedded resources not named correctly - jmeter

I'm using an HTTP sampler to download embedded resources. Here's is the example from python.org. I was expecting the the names of the embedded resources to match the actual request. But instead they're named the same as the parent sample. Could be by product of HTTPS? I'm using JMeter 5.3.

This is a part of enhancement introduced in JMeter 5.0, see Bug 62550 - Modify SubResult Naming Policy for details.
If the previous behaviour is really what you're looking for you can get it back in 2 ways:
Tick "Functional Test Mode" box at Test Plan level
Add subresults.disable_renaming=true line to user.properties file

when you record the transaction it should generate the sample names normally.
Are you using parallel controller ?
Actually you can tweak with settings of naming policy in jmeter properties.

Related

JMeter 5.4.3 "Generate Paranet Sample" is not working in Non GUI test

I like to generate HTML report with parents transactions only not with all child sample in JMeter 5.4.3
I checked the box "Generate Parent Sample" in transaction controller. But when I execute non gui test from command I see all child sample are included.
Can some help?
Thanks
Saleem Soomro
I believe that's a bug in JMeter (at least since JMeter 5.0) so you can raise it via JMeter Bugzilla.
If you don't want to see these "extra" results in the HTML Dashboard the options are in:
Downgrade to JMeter 4.0 where Transaction Controller still works according to documentation which states:
In parent mode, the individual samples can still be seen in the Tree View Listener, but no longer appear as separate entries in other Listeners. Also, the sub-samples do not appear in CSV log files, but they can be saved to XML files
Add the next line to user.properties file:
jmeter.save.saveservice.subresults=false
this way you will have only "parent" sample results in the .jtl results file (it may have some negative side effect resulting in improper calculation of the throughput when it comes to i.e. embedded resources)

Any option to change the name of the file which is on disk during runtime to execute upload functionality in Jmeter

I have a scenario where one of the test REST API returns a transaction_Id, this transaction Id I need to pass in my next request(API Request), also upload the file as well. This upload file has name format like ${transaction_Id}_1_1_bkg.raw,without correct format backend server may not be able to analyze the data.
Since I have to run a load test, these transaction Ids will generate at run time and the same I have to change the file name and upload it as well.
Did any one had face this challenge before in Jmeter to change the file name at run time and upload it, if yes, what was the solution.
Thanks,
Akshat
You could copy the file to a new one with the desired name using JSR223 PreProcessor like
org.apache.commons.io.FileUtils.copyFile(new File('template_bkg.raw'), new File(vars.get('transaction_Id') + '_1_1_bkg.raw'))
where vars stands for JMeterVariables class instance, see the JavaDoc for more information on all existing functions and Top 8 JMeter Java Classes You Should Be Using with Groovy article to learn more about JMeter API shorthands available for the JSR223 Test Elements.
Once upload is finished you can delete the file using JSR223 PostProcessor

Unable to pass Jmeter recording test when running the test in real website- one section get fail?

I want to do load test as well as performance test a website and I have recorded user step by step action through jmeter recording by proxy setting. And when I run this recorded test it gets passed all the sections except one section.
During recording steps, it gets filled all the required fields like POST, GET, PATH etc by default as well as like token, session id etc in the HTTP header manager. When user login again its get unique session id and token through Regular Expression Extractor. But my test gets failed when the user wants to accept a task it says unauthorized. I have attached screenshot.
This image showing all the steps user will do from login to logout.
Here steps 2.9 section gets fail.
Here its showing the response from the server.
Please let me know where am I doing wrong.
There are multiple possible issues with your test:
Location of the Regular Expression Extractor and other Post and Pre-Processors. According to JMeter Scoping Rules they are applied to all your Samplers so please double check if this is something you're looking for. If you want to apply the Post-Processor to a single sampler - you need to move it to be a child of the particular sampler
Since JMeter 3.1 it's recommended to use JSR223 Test Elements and Groovy language for scripting so consider converting your Beanshell test elements into JSR223 ones
Since JMeter 3.0 there is JSON Extractor which you should be using instead of the plugins
In general HTTP status 401 means Unauthorized so double check that your test is doing what it is supposed to be doing using View Results Tree listener. You might also want to double check JMeter Variables values using Debug Sampler as it might be the case that the variables are being overwritten with something you don't expect due to the aforementioned Scoping Rules potential issue

JMeter - How do you group all requests related to a page to provide cleaner results?

Im new to JMeter and have just created a test plan using the proxy server.
The test plan covers a fairly long user journey on a web app with a lot of pages, images, scripts and css being requested, because of this when I run the test plan and view the results in a listener such as the 'View Results Tree' the sampler list is very long and if I try and use a graph there are so many results its hard to make out individual values.
Is there a way in JMeter where I could group all the requests related to a page under that page and only have to page name display in the listener but still have the ability to drill into an individual page and see the details for each sample?
Thanks.
For this you can use Transaction Controller:
https://jmeter.apache.org/usermanual/component_reference.html#Transaction_Controller
Keep Include duration of timer and pre-post processors in generated sample unchecked.
If you're looking to learn jmeter correctly, this book will help you.
I agree with PMD, Transaction controller is exactly what you need.
You can achieve that automatically (while you're saving your test) if you enable jMeter proxy's option Put each group in a new transaction controller.
A couple of more details (about jMeter Plugins' listeners I regularly use) here:
Define a group of requests in order to obtain a total time in Jmeter
You can use the tool BADBOY tool to record your test and there you can easily bifurcate/ remove the unwanted content.
From BADBOY you can directly Export the recorded script to JMeter by simply from
File menu>>Exort To JMeter
This is what currently we are following and is a bit easy to use.

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