Article From:https://www.cnblogs.com/better0903/p/9065265.html

1. Interface test

Interface test is function test, which is simpler than UI test.

The interface is to retrieve data from database and return to it.

The general interface returns the JSON format string; JSON is a general data type.

 

Front end and back end

Client, server

The lower the lower the cost of bug to repair bug;

 

GetThe difference from the POST request

GetRequest: its request data is placed in URL.

PostRequest: its request data is placed in body.

 

Cookie:A key value pair stored locally, that is, key-value

Session:A key value pair stored on the server side;

 

Two, Jmeter performance testing tools

JmeterWrite scripts

1、Modify JMeter to view the result tree random code problem:

Find the jmeter.properties file in the jmeter\bin directory and find the following sampleresult.default.encoding.

sampleresult.default.encoding=utf-8

Keeping the file and restarting JMeter can solve the problem of JMeter returning to solve the garbled problem.

 

 

2、  jmeterSending post information in body data contains Chinese information displaying garbled code to solve the body data Chinese garbled problem:

Find the jmeter.properties file in the jmeter\bin directory, find the jsyntaxtextarea.font.family=Hack line, remove the number and restart JMeter.

 

 

3、  The Chinese shown in body data is correct, but after running, the data is checked in the database, but it needs to be added to UTF-8.

 

 

JmeterParameterization

1、  User defined variables (thread group -> add configuration element -> user defined variables)

The user – defined variable in the configuration element can be a global variable that can be called in other sample; if the value in the variable has a change, it can be modified here, without a single modification in the sample;

The configuration element is similar to the default value of the HTTP request in the configuration element, and if the HTTP request is added to the default value, the default value is used directly if some values are not filled in the later HTTP request, and if some values are filled in the later HTTP request, the rear face http is first used.The value of the parameter in the request.

 

2、  The function assistant inside:

__random(In the option -> the function Assistant dialog box, select the __Random function, can generate a random variable parameter, call in the later function, test)

 

__time    yyyyMMddHHmmddThe format of the time (this is a 24 hour system)

You can also use the __time function to generate a random number to be invoked in other requests.

 

JmeterThe time stamp from the inside is accurate to milliseconds.

Time stamping is the number of seconds from the day the computer was born.

3、  Read in the file

The default is not to write the absolute path, but to read the file from the bin directory of JMeter;

Multiple columns can be written in the file, separated by commas, and the names of parameters should be separated by commas.

 

JmeterPressure measurement

Concurrent user number

Tps:The higher the number of requests per second to be processed, the better the better

Response time: the faster the better

jmeterPress test can see response time and TPS through aggregate report.

If you want to carry out the pressure measurement, you need to configure the corresponding thread number, cycle number and scheduling time on the thread group.

 

Similar Posts:

Link of this Article: Interface test base

Leave a Reply

Your email address will not be published. Required fields are marked *