JMeter csv, user-defined variables, and query type Analysis (eight)

Source: Internet
Author: User

Many children's shoes do not know for JMeter query Type do not know which to choose, why choose, how to choose!

Here's a simple analysis,

So first what is CSV Data Set Config, what's the use?

CSV data Set config is a configuration element used to insert a reference file, assuming that the children's shoes in the test, the need to insert multiple data, when inserting hundreds of data, if the use of a SELECT statement is very troublesome, then you can use the CSV to complete, The so-called bulk fetch data

FileName: The address of the file you want to import (TXT document to write the batch data you want to add) Note: The document path does not use the Chinese path, here for the intuitive expression so in Chinese written out.

File Encoding: Encoding

Variable Names (comma-delimited): variable name, this variable name according to "user-defined variables" to write in, such as TXT document contains "name, gender, age", then this can be filled in name,sex,age. Like this ~

Delimiter (use ' \ t ' for tab): Split with what, "," means comma-separated

Allow quoted data?: False By default allows reference to a value

Recycle on eof?:ture the meaning of the loop value , assuming that the TXT document has only 3 data, but I want to insert 4 data, then whether or not to loop the data after the end of the collection

Stop thread in Eof?:false No data addition is stopped

Let's give an example.

FileName: Reference file

The contents of the file are as follows allow quoted data to reference values
For example, if the TXT file content in Shanghai to add double quotation marks "Shanghai", you need to add to the database at the same time Allwo quoted data side to choose False if you do not want to add double quotes into the database then select Turerecycle on EOF reference Whether to allow duplicates, such as only 3 data in the TXT file, add more than three cycles in the thread group, the result shows the following result if repeat is not allowed, then the result will display the error value on the stop thread on EOF Comment: No data addition is stopped as If you select False to not stop, the number of cycles will be completed. If you choose Ture if no data is added, stop executing the values in the statement below, and add the variable in the CSV (ii) Analysis of selected callable in CSV

Let's start with a wrong way of doing it.

The query statement uses the following statement to insert the statement and query the results to insert into LAM values (null, ' small Seven ', ' Guangzhou ', ' 222-2222 '); select * from Lam; When callable is selected, auto, which chooses false, executes successfully, but no data is added to the database. So it's wrong to do so. When choosing callable, auto, select Ture, execute successfully, and the database will add data normally. This situation is the right approach Summary, type selection callable when the time is no matter whether the addition or deletion of the statement put in front, or query statements put forward, are not affected,   The key is:   when type chooses callable (callable case), Auto chooses Ture,jmeter to execute correctly and adds data successfully.     if Type selects select (query) or update (add-on), then Auto is also to choose Ture; False in JMeter shows that execution succeeds, but no data is added in the database, but it takes up a row of ID locationsAlso to say is the figure below, if query is in the case of the first row, then type selects select; if the add-in in query is in the first row, then type should choose Update;

JMeter csv, user-defined variables, and query type Analysis (eight)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.