Blazemeter Multitest Configuration in taurus.yml - jmeter

I am running Multiple JMeter scripts (Multi-Test) in Blazemeter where Each script has its own taurus.yml file, So I am running 5 JMeter scripts with 5 taurus.yml, Each time has to edit taurus.yml for concurrency and hold-for.
Is there a way to set same execution values on all scenarios with 1 declaration?

you can add another (6th) YAML file where your concurrency and hold-for attributes will be specified and use included-configs directive to load the file with concurrency and hold-for into each of 5 files.
This way you will be able to amend the values in one place only.

Related

Can we parameterize Thread schedule details like Start Thread count, Initial delay etc. in Ultimate thread Group using csv/txt files?

We are trying to parameterize Thread schedule details like Start Thread count, Initial delay etc.
Since we have 50+ thread groups and handling them has become an issue.
Would like to know if Jmeter has any unknown feature for this or a workaround to achieve this?
Can we parameterize these values from a csv/txt file?\
Note: We have 50+ thread groups, hence using ${__CSVRead} and retrieve different values didn't work out.
Have tried out ${__CSVRead} but since we need different values for each thread, this isn't working out.
I can only think of "known" feature - using either user.properties file or a custom .properties file, i.e.
thread.group.1.start.threads=10
thread.group.1.initial.delay=5
thread.group.2.start.threads=50
thread.group.1.initial.delay=20
etc.
and you will be able to use __P() function in the Ultimate Thread Group to read the values from the .properties file:
If you put the values into user.properties file - you won't need to do anything else, the file will be picked up automatically, if you decide going for the custom .properties file - you will need to pass it via -q command-line argument:
jmeter -q /path/to/your/thread/group.properties -n t .....
More information:
Configuring JMeter
Apache JMeter Properties Customization Guide
Full list of command-line options

JMeter Thread Groups - Is it possible to make the same instance of one behave as a time based or an iteration based element dynamically at runtime?

I am creating a JMeter Test Harness that will be run from Jenkins using "Build with Parameters' to set runtime parameters that are passed into JMeter as Properties using -J attributes.
End users will be given the choice of running tests either based on the number of iterations or a period of time.
I can easily interrogate a passed in property value to determine if an 'iteration' or 'time' based test type and in order to try this I have added variables (which may or may not be have values depending) for ALL of the Thread Group 'Thread Properties' fields as can be seen below. Each variable will have a value of either 0 or 1+ depending upon the Jenkins parameters passed in at runtime.
enter image description here
As I do not want to create 2 Thread Groups (one for iteration based, and the other time based) then use logic controllers or similar to control what way to test, is there a dynamic way to switch the Thread Group 'Thread Properties" behaviour at run time using the singular Thread Group?
enter image description here
Any help in making 1 thing do 2 things in my little world of JMeter will be greatly appreciate!!
Not really, with "vanilla" JMeter you can:
Set number of iterations to -1 for "duration" based test
Set duration to a very long value (a couple of years) for the "iteration" based test
Other options are in:
JMeter .jmx scripts are basically XML files and XML is a subset of text so you can use a text editor like sed to substitute values directly in the .jmx file
Taurus automation framework has a nice feature of modifying an existing JMeter test before launching, it allows overriding absolutely any property of absolutely any element.

Is there a way to pass user defined variable through csv file in JMeter?

There are multiple API thread groups and each thread group will have different configuration for threads, ramp up time, duration, throughput controller percent execution variable etc.
Can I pass these variable from a .csv file? My aim is to create a config file and pass as a input in non gui mode during execution.
I have seen option for setting property from command line like using J_ or defining property but as number of thread groups are huge I won't be able to use this option. Also CSV data, beanshell preprocessor config cannot be used as i have to set thread group level details.
You can use JMeter Plugin Variables From CSV to pass the variable from a CSV file to Thread Groups.
Create the test data in variable=value format
Install the plugins manager
Install the Plugin Variables From CSV through plugins manager
Add Variables From CSV config element and configure to read the variables and click on Test button
Copy the variables
Paste into the thread groups

Setting up user.properties in jmeter for several load test

I'm setting up a load test for several threads that each one needs a specific token.
How can I outsource it via csv file or other solution?
Screenshot of code:
You can use a csv data set config in jmeter for csv/txt files. Keep data in external csv or text file and use in your jmeter script using csv data set config for your desired threads.
Make sure the number or records in the file should be the same as the number of threads you want to execute.
https://octoperf.com/blog/2018/01/25/jmeter-csv-data-set-config/

JMeter tests in Non-GUI mode are not trustworthy

The test scripts on GUI works perfect but not in the non-GUI mode.Image showing Terminal test execution
Explanation:
I have 3 thread groups in the test plan, where the first Thread Group creates 3 .csv files and are expected to feed the data in the CSV files into the second Thread Group.
For few test runs, Non-GUI mode worked great but then, the tests Intermittently like this [Terminal showing test run], doesn't create the CSV files at all and also,
sometimes, third Thread Group doesn't execute at all.
The problem I noticed is:
During the NOn-GUI tests the files are not been creating, so that's the reason the next Thread groups weren't able to pick up and use the variables inside CSV file and also
The second One could be: I'm saving folder and file paths in the
${__setProperty(prop_folder_Path,${File_Path})} and getting the prop.
${__property(prop_folder_Path)} in another Thread Group -> Sometimes this property function Doesn't work and files are saving in /bin Directory
Is there a way to use ${__property(prop_folder_Path)} value in BeanShell POStProcessor ?
I believe whatever works in the GUI should work same in the Non-GUI too, AM I right?
I Just noticed that output files are creating in /bin folderas shown here while running the tests in NOn-GUI
Any suggestions to fix this. Thank you
My expectation is that your ".csv" files creation fails somewhere somehow therefore 2nd thread group is not able to operate due to missing files.
JMeter doesn't have any build-in functionality to write something into the file so I think you implemented some custom logic using i.e. JSR223 Scripting which doesn't work. The reasons could be in:
If you're running JMeter from another folder the .csv files can be created in a different location, try using full paths just in case.
Non-GUI mode tends to be faster than GUI mode so it might be the case of multithreading issue i.e. when multiple threads are trying to write data into the same file concurrently and clash or produce not well-formed data.
In both cases the answer will live in jmeter.log file, check it for any suspicious entries and fix the causes.
In general using files to pass data between thread groups is not the best idea, I would recommend doing it in-memory instead, for example:
In 1st Thread Group use __setProperty() function to convert your data which you store in CSV file into JMeter Properties like:
${__setProperty(foo,bar,)}
In 2nd Thread Group use __P() function to read the data like:
${__P(foo,)}
More information: Knit One Pearl Two: How to Use Variables in Different Thread Groups

Resources