using Counter I want unique values to be picked for three times in the same thread itself. Is it possible? Data is called from CSV Data Set Config - jmeter

using Counter I want unique values to be picked for three times in the same thread itself. Is it possible? Data is called from CSV Data Set Config
using Counter I want unique values to be picked for three times in the same thread itself. Is it possible? Data is called from CSV Data Set Config

Related

How Can i avoid repeated/duplicate test data or to avoid already executed data without deleting in CSV file?

We have a constrain in our application, For test data providing in JMeter execution (using CSV Data Set Config element) we are not supposed to provide duplicate test data and it won't accept in all the fields. So we kept unique test data (upto 8K data for 8k concurrent users) for all the fields in CSV format.
Here I have a manual intervention, After each test execution (i.e) 100 users, 1000 users up to 8000 users) we need to delete each row (WRT to users in thread group) in CSV file else the duplicate data will be fetching for next execution and result will be failed.
Here my questions is,
1. How Can i avoid repeated/duplicate test data or to avoid already executed data without deleting in CSV file.
2. During JMeter test execution with CSV files, How can we specify to take the data from the respective rows. For example 101th row, 1001th row & 7999th row (which contains 8000 rows of data)?
The easiest option will be using HTTP Simple Table Server, its READ command has KEEP=FALSE attribute so you will be able to feed your test with the unique data without having to physically remove it from the original CSV file.
You can install HTTP Simple Table Server plugin using JMeter Plugins Manager:
In general if your test doesn't need to be repeatable instead of keeping the data in the CSV file you can consider generating it on the fly using such JMeter Functions as:
__Random()
__RandomString()
__RandomDate()
__UUID()
etc.

Jmeter how to generate threads as per number of columns in a csv file and each thread should pick up data from multiple rows of a specific columns

We are trying to establish no of threads depending on the number of columns present in a csv file, and each thread should pick up data from respective rows of those columns.
can someone help us out in achieving the same.
So from the attached screenshot we would want 6 threads to be established and thread1 should be posting data under user1 itself, thread2 from user2 and so on.
To achieve this you can use CSV Data Set Config
How to set CSV Data Set Config?
Right Click on thread group
Navigate to Add > Config element
Click on CSV Data Set Config
Create one csv or txt file and CSV Data set config as per below attached screenshot.
Whenever you want to user your values, just provide ${user1}, ${user2} and so on.
For more details you can refer CSV Data Set Config from user manual.

How to find all the files created by GenerateTableFetch has been processed

We have a flow where GenerateTableFetch takes inpute from splitJson which gives TableName, ColumnName as argument. At once multiple tables are passed as input to GenerateTableFetch and next ExecuteSql executes the query.
Now i want to trigger a new process when all the files for a table has been processed by the below processor (At the end there is PutFile).
How to find that all the files created for a Table has been processed?
You may need NIFI-5601 to accomplish this, there is a patch currently under review at the time of this writing, I hope to get it into NiFi 1.9.0.
EDIT: Adding potential workarounds in the meantime
If you can use ListDatabaseTables instead of getting your table names from a JSON file, then you can set Include Count to true. Then you will get attributes for the table name and the count of its rows. Then you can divide the count by the value of the Partition Size in GTF and that will give you the number of fetches (let's call it X). Then add an attribute via UpdateAttribute called "parent" or something, and set it to ${UUID()}. Keep these attributes in the flow files going into GTF and ExecuteScript, then you can use Wait/Notify to wait until X flow files are received (setting Target Signal Count to ${X}) and using ${parent} as the Release Signal Identifier.
If you can't use ListDatabaseTables, then you may be able to have ExecuteSQLRecord after your SplitJSON, you can execute something like SELECT COUNT(*) FROM ${table.name}. If using ExecuteSQL, you may need a ConvertAvroToJSON, if using ExecuteSQLRecord use a JSONRecordSetWriter. Then you can extract the count from the flow file contents using EvaluateJsonPath.
Once you have the table name and the row count in attributes, you can continue with the flow I outlined above (i.e. determine the number of flow files that GTF will generate, etc.).

Use next CSV file when all values used

I have 10 CSV files with usernames with 1 million records each. Ideally I want to use an unique value for every thread and when all values from the first CSV file have been used, it should start using the values from the second CSV file, and so on.
Adding multiple CSV Data Set Config elements is no problem and it is easy to add them to a If or While controller. But what can be the trigger to go to the next file?
As an alternative, I use multiple If controller with e.g. ${__eval(${__threadNum})} < 1000 and ${__eval(${__threadNum})} > 1000 and ${__eval(${__threadNum})} < 2000 to make sure the users read from different CSV files, but this is a bit cumbersome when the number of users change often, because you need to change the if conditions accordingly.
Perhaps you should consider switching to __CSVRead() function which is capable of fetching data from multiple CSV files. Optionally in conjunction with __counter() function if you need to switch files based on certain condition
See How to Use JMeter Functions post series for advanced information on aforementioned and more useful JMeter Functions.

how to login multiple users with different input in different threads in Jmeter using CSV data set config

How to login multiple users with different input in different threads in Jmeter using CSV data set config?
I have added CSV data set config but the thread is picking only the first entry and i m not able to see the responses for other user login
If you use CSV data set config which contains parameterized values which users(threads) will use while running script.
below is snapshot of jmeter of csv data set config which contain emp.csv file which contains values like,
nachiket,101,test
nikhil,102,test
harish,103,test
which are empname,empid,passwd respectively for 3 users.
if you run test with 3 users then thread1 will pick first and 2nd thread will pick 2nd val so on and you can repeat the file if it has less values than no of threads.
You need to provide enough loops/iterations as given one iteration only CSV Data Set Config will read only the first entry.
Try putting the request you want to parametrize under a Loop Controller, set enough loops and see whether it resolves your issue.
See Using CSV DATA SET CONFIG guide for more details.

Resources