Jmeter of csv, user-defined variables, and Query Type analysis (h) (reprint) Jmeter of csv, user-defined variables, and Query Type analysis (eight)

Jmeter of csv, user-defined variables, and Query Type analysis (eight)

I do not know a lot of children's shoes for the Query Type Jmeter do not know what to do, why choose, how to choose!

Below here do a simple analysis,

So first of all what is the CSV Data Set Config, what use is it?

CSV Data Set Config is used to insert a reference file of configuration elements, assuming that said children's shoes are doing the test of time, you need to insert multiple data, insert data hundreds of times, if you insert a select statement, then it is very troublesome, then you can use csv to complete, so-called batch fetch data

Filename: file that you want to import addresses (TXT document written inside a batch-type of data you want to add) Note: Do not use the Chinese path document path, here it is written in Chinese out for visual expression.

File encoding: coding    

variable Names (comma-delimited): variable name, variable name according to "user-defined variables" to write in, for example, txt document which includes "name, sex, age," then here you can fill in the name, sex , age. Like this ~

Delimiter (Use '\ t' for tab): What to split, "" indicates separated by commas

Allow quoted data ?: default False        allows reference data values

Recycle on EOF:? Ture       cycle values mean , assuming that only three data TXT files, but I want to insert four data, whether that data fetch cycle after take complete  

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

For example the following

 

filename: references 
 
 

 
Document reads as follows
allow quoted data   允许引用数据值

例如
如果txt文件内容中 上海 添加双引号 即 “上海"  ,需要同时添加进数据库  那么 allwo quoted data 这边要选择为false
如果不想将双引号添加进数据库 那么就选择 ture
recycle on eof      引用是否允许  重复,
例如 txt文件中 只有3条数据 ,在线程组中添加循环次数 超过三次,那么 结果显示 如下 
结果如下
如果 不允许重复,选择false
 
那么结果 会显示错误值
在stop thread on eof  注释:无数据添加是否停止 
如果选择 false
 就是不停止,
会将循环次数 执行完成。
如果选择ture  如果没有数据添加时 即停止执行
 
 
 
下面是语句中的值 ,在csv中的variable 中 添加 即可
 
(二)csv中选择 选callable的情况分析

先来个错误的执行方式

查询语句  用下面的语句去插入语句以及查询出结果来
insert into Lam values(null,'小七','广州','222-2222');
select * from Lam;
 
当选择 callable 的时候,auto,选择false的情况,执行是成功,但是数据库中并不会添加任何数据。所以这么执行是错误的
当选择 callable 的时候,auto,选择ture的情况, 执行成功,数据库也正常添加数据。这种情况是正确的做法
 
 
总结,type选择  callable的时候 是不管 增删改语句放前面,还是查询语句 放前面,都是没有影响,
 
关键是:
 
当type选择callable(可调用的情况) 的时候,auto 要选择ture,jmeter才能正确的执行 并且成功添加数据。
 
 
如果type选择select (查询)或者  update(增删改)时候,
那么  auto也同样都是要选择ture; 选择false在jmeter中都是显示执行成功,但是数据库中并不会添加任何数据,反而会占用一行ID 位置
 
 
 
 
还有要说的就是   图如下,
 
如果 query中 查询语句是在第一行的情况,那么type要选择select;
如果 query中 增删改语句是在第一行的情况,那么type要选择update;

Guess you like

Origin www.cnblogs.com/yuany66/p/10979360.html