Jmeter's csv, user-defined variables and Query Type analysis

Many children's shoes do not know which Query Type to choose for Jmeter, why and how to choose!

Here is a simple analysis,

So first of all, what is CSV Data Set Config and what is its use?

CSV Data Set Config is a configuration element used to insert reference files. Suppose that children's shoes need to insert multiple pieces of data when they are doing tests. When inserting hundreds of pieces of data, it is very troublesome to insert them with select statements. Then you can use csv to complete, that is, the so-called batch data fetching

Filename: It is the address of the file you want to import (the batch data you want to add is written in the TXT file) Note: The file path should not be in Chinese. It is written in Chinese for intuitive expression.

File encoding: encoding    

variable Names (comma-delimited): variable name, this variable name is written according to the "user-defined variable", for example, the txt document contains "name, gender, age", then you can fill in name, sex here , age. like this~

Delimiter (Use '\t' for tab): what to use to separate, "," means to separate with commas

Allow quoted data?: Default False        to allow quoted data values

Recycle on EOF?:        The meaning of Ture cycle value , assuming that the TXT document has only 3 pieces of data, but I want to insert 4 pieces of data, then whether to fetch these data in a loop after fetching  

Stop thread in EOF?: False         if no data is added to stop

Here's an example

 

filename: referenced file 
 
 

 
The content of the file is as follows
allow quoted data allows quoted data values

E.g
If double quotation marks are added to Shanghai in the content of the txt file, that is, "Shanghai", and it needs to be added to the database at the same time, then allwo quoted data should be selected as false.
If you don't want to add double quotes into the database then choose true
recycle on eof whether the reference is allowed to repeat,
For example, there are only 3 pieces of data in the txt file, and the number of loops is added to the thread group more than three times, then the result is shown as follows 
The result is as follows
Select false if duplicates are not allowed
 
then the result will show the wrong value
Note in stop thread on eof: Does no data add stop? 
if false is selected
 just don't stop,
The number of loops will be executed.
If ture is selected, the execution will stop when no data is added
 
 
 
The following is the value in the statement, just add it to the variable in csv
 
(2) Analysis of the situation of selecting callable in csv

First come the wrong way of execution

Query Statement Use the following statement to insert the statement and query the result
insert into Lam values(null,'Xiaoqi','Guangzhou','222-2222');
select * from Lam;
 
When select callable, auto, select false, the execution is successful, but no data will be added to the database. So doing this is wrong
When the callable is selected, auto, and ture is selected, the execution is successful, and the database also adds data normally. This situation is the right thing to do
 
 
To sum up, when the type selects callable, it has no effect whether the addition, deletion and modification statements are placed in the front, or the query statements are placed in the front.
 
The key is:
 
When type selects callable (callable case), auto must select ture so that jmeter can execute correctly and add data successfully.
 
 
If type selects select (query) or update (addition, deletion and modification),
Then auto also needs to choose ture; choose false in jmeter to show that the execution is successful, but no data will be added to the database, but a row of ID will be occupied.
 
 
 
 
There is another thing to say is that the picture is as follows,
 
If the query statement in the query is in the first row, then the type should be select;
If the addition, deletion and modification statement in the query is in the first line, then the type should select update;

Here is a simple analysis,

So first of all, what is CSV Data Set Config and what is its use?

CSV Data Set Config is a configuration element used to insert reference files. Suppose that children's shoes need to insert multiple pieces of data when they are doing tests. When inserting hundreds of pieces of data, it is very troublesome to insert them with select statements. Then you can use csv to complete, that is, the so-called batch data fetching

Filename: It is the address of the file you want to import (the batch data you want to add is written in the TXT file) Note: The file path should not be in Chinese. It is written in Chinese for intuitive expression.

File encoding: encoding    

variable Names (comma-delimited): variable name, this variable name is written according to the "user-defined variable", for example, the txt document contains "name, gender, age", then you can fill in name, sex here , age. like this~

Delimiter (Use '\t' for tab): what to use to separate, "," means to separate with commas

Allow quoted data?: Default False        to allow quoted data values

Recycle on EOF?:        The meaning of Ture cycle value , assuming that the TXT document has only 3 pieces of data, but I want to insert 4 pieces of data, then whether to fetch these data in a loop after fetching  

Stop thread in EOF?: False         if no data is added to stop

Here's an example

 

filename: referenced file 
 
 

 
The content of the file is as follows
allow quoted data allows quoted data values

E.g
If double quotation marks are added to Shanghai in the content of the txt file, that is, "Shanghai", and it needs to be added to the database at the same time, then allwo quoted data should be selected as false.
If you don't want to add double quotes into the database then choose true
recycle on eof whether the reference is allowed to repeat,
For example, there are only 3 pieces of data in the txt file, and the number of loops is added to the thread group more than three times, then the result is shown as follows 
The result is as follows
Select false if duplicates are not allowed
 
then the result will show the wrong value
Note in stop thread on eof: Does no data add stop? 
if false is selected
 just don't stop,
The number of loops will be executed.
If ture is selected, the execution will stop when no data is added
 
 
 
The following is the value in the statement, just add it to the variable in csv
 
(2) Analysis of the situation of selecting callable in csv

First come the wrong way of execution

Query Statement Use the following statement to insert the statement and query the result
insert into Lam values(null,'Xiaoqi','Guangzhou','222-2222');
select * from Lam;
 
When select callable, auto, select false, the execution is successful, but no data will be added to the database. So doing this is wrong
When the callable is selected, auto, and ture is selected, the execution is successful, and the database also adds data normally. This situation is the right thing to do
 
 
To sum up, when the type selects callable, it has no effect whether the addition, deletion and modification statements are placed in the front, or the query statements are placed in the front.
 
The key is:
 
When type selects callable (callable case), auto must select ture so that jmeter can execute correctly and add data successfully.
 
 
If type selects select (query) or update (addition, deletion and modification),
Then auto also needs to choose ture; choose false in jmeter to show that the execution is successful, but no data will be added to the database, but a row of ID will be occupied.
 
 
 
 
There is another thing to say is that the picture is as follows,
 
If the query statement in the query is in the first row, then the type should be select;
If the addition, deletion and modification statement in the query is in the first line, then the type should select update;

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324808256&siteId=291194637