当前位置:网站首页>Learn the interface test, see it is very good, and make a note
Learn the interface test, see it is very good, and make a note
2022-06-25 05:29:00 【qq_ forty-one million five hundred and fifty-four thousand six 】
One 、 Test requirement description
1、 The interface of this test is http Server interface
2、 There are two main types of interfaces , A class of interfaces provided to query functions , One class provides the function interface for saving data , Here's an example 2 Interfaces for saving data , Because these two interfaces are related , It's more representative ;
3、 Interface description :
Interface for saving credit card account information :
Pass in the parameter :
args={
"clientNo":"434343556",
"alias": "** The credit card 2",
"cardName": " The Great Wall ***** card 2",
"cardNo": "25622356788251",
}
Out parameter :
Saved successfully :{"returnCode":"0","returnMsg":" Saved successfully "}
Save failed :{"returnCode":"1","returnMsg":" Save failed "}
Save logic : Data comes in , Verification passed , Save to credit card account table
Save credit card bill interface :
Pass in the parameter :
args={
"clientNo":"434343556",
"accountName": " test ",
"billDate": "08",
"billMonth": "201509",
"cardNo": "25622356788251",
"currentPayment": " arrears 459.80",
"paymentDate": "2015-09-25 09:00:00",
}
Out parameter :
Saved successfully :{"returnCode":"0","returnMsg":" Saved successfully "}
Save failed :{"returnCode":"1","returnMsg":" Save failed "}
Save logic : Before saving, go to the credit card information table to view clientNo Whether the corresponding table exists , If it exists, the data verification passes ,
Save the data into the credit card statement
notes : This saving logic may not be written or detailed in the interface development and design document , At this time, communicate with the development interface personnel or product personnel to get familiar with the interface logic
Two 、 Test and analysis
1、 logic analysis
1)、 From the perspective of saving logic , The two interfaces are obviously dependent , So we First Test the credit card account information interface , Retest Save credit card bill interface
2)、 Data from the interface , Finally, it is saved to the database , So when the interface returns that the save succeeded , We have to go to the corresponding Check in the database table The corresponding data ( You can use it here jmeter Link the database to operate the agent manually )
3)、 When saving fails , We need to Check the system log , So we should also be prepared to view the permissions and addresses of logs
2、 Preparation of test tools
1)、 Single interface test , We use Firefox plug-ins poster
2)、 Multiple interface tests , We use Jmeter To test
3、 ... and 、 Use tools to test
1、Poster For the usage of tools, see
http://note.youdao.com/share/?id=a3efa149d165258710ebf1bd04079f72&type=note
2、 Use Jmeter Interface test
First of all, let's talk about why Poster After the test, we need to use Jmeter Do interface tests , In use poster When testing, we will find that it is an interface to interface test , The data after each successful test , It can't be saved in tools , When we test again, we need to re-enter the test data , When we test an interface, it may not feel obvious , But when you test dozens of interfaces , You will find the use of Jmeter The benefits of , If the smoke test is conducted according to the test stage, we use poster, Integration testing we use Jmeter
Four 、 Use Jmeter The interface test
1、 First, add a thread group to the mail , Here we rename InterfaceTest
2、 Add a... To the thread group Http Default request , And configure the IP Address and transmission code
3、 Add a... To the thread group HTTP request , Here we rename “ Add credit card account information interface ”
4、 Configure interface request information , This configuration example is as follows :
5, When saving the credit card bill interface request , Examples are as follows :
notes : because Jmeter Requests within a thread group are executed from the first , So we put the request that needs to be executed first
6、 Add listeners to thread groups , Look at the result tree and aggregate report
7、 Click start , Check... After running , Result tree and aggregation report
8、 Check the data in the database
9、 Mass data manufacturing
Ideas :
1)、 Parameterizable parameters , Interface for saving credit card account information (clientNo,cardNo), Save credit card bill interface (clientNo,cardNo,billMonth,paymentDate)
2)、 The dependencies of the two interfaces , Save credit card bill interface (clientNo,cardNo) Interface with credit card account information (clientNo,cardNo) The two of are the same , That is to say, these two need a parameter , And it cannot be repeated
According to the above two characteristics ,(clientNo,cardNo) We choose to use counters , The counter is incremented once per cycle 1, Then we set the thread group to execute circularly 1 Ten thousand times ;billMonth,paymentDate, We use random functions for these two dates ${__Random(1,9,)}, Parameterize the month ;
3)、 Create counters on thread groups , The configuration is as follows :
4)、 Reference counters and random functions
The credit card account interface passes in parameters
args={
"clientNo":"${add}434343556",
"alias": "** The credit card 2",
"cardName": " The Great Wall ***** card 2",
"cardNo": "${add}25622356788251",
}
The bill interface passes in parameters
args={
"clientNo":"${add}434343556",
"accountName": " test ",
"billDate": "08",
"billMonth": "20150${__Random(1,9,)}",
"cardNo": "${add}25622356788251",
"currentPayment": " arrears 459.80",
"paymentDate": "2015-0${__Random(1,9,)}-25 09:00:00",
}
5)、 Set up thread group loop test , Click on the run , View the run results , Go to the database again , Large quantities of data are thus generated
One 、 Test requirement description
1、 The interface of this test is http Server interface
2、 There are two main types of interfaces , A class of interfaces provided to query functions , One class provides the function interface for saving data , Here's an example 2 Interfaces for saving data , Because these two interfaces are related , It's more representative ;
3、 Interface description :
Interface for saving credit card account information :
Pass in the parameter :
args={
"clientNo":"434343556",
"alias": "** The credit card 2",
"cardName": " The Great Wall ***** card 2",
"cardNo": "25622356788251",
}
Out parameter :
Saved successfully :{"returnCode":"0","returnMsg":" Saved successfully "}
Save failed :{"returnCode":"1","returnMsg":" Save failed "}
Save logic : Data comes in , Verification passed , Save to credit card account table
Save credit card bill interface :
Pass in the parameter :
args={
"clientNo":"434343556",
"accountName": " test ",
"billDate": "08",
"billMonth": "201509",
"cardNo": "25622356788251",
"currentPayment": " arrears 459.80",
"paymentDate": "2015-09-25 09:00:00",
}
Out parameter :
Saved successfully :{"returnCode":"0","returnMsg":" Saved successfully "}
Save failed :{"returnCode":"1","returnMsg":" Save failed "}
Save logic : Before saving, go to the credit card information table to view clientNo Whether the corresponding table exists , If it exists, the data verification passes ,
Save the data into the credit card statement
notes : This saving logic may not be written or detailed in the interface development and design document , At this time, communicate with the development interface personnel or product personnel to get familiar with the interface logic
Two 、 Test and analysis
1、 logic analysis
1)、 From the perspective of saving logic , The two interfaces are obviously dependent , So we First Test the credit card account information interface , Retest Save credit card bill interface
2)、 Data from the interface , Finally, it is saved to the database , So when the interface returns that the save succeeded , We have to go to the corresponding Check in the database table The corresponding data ( You can use it here jmeter Link the database to operate the agent manually )
3)、 When saving fails , We need to Check the system log , So we should also be prepared to view the permissions and addresses of logs
2、 Preparation of test tools
1)、 Single interface test , We use Firefox plug-ins poster
2)、 Multiple interface tests , We use Jmeter To test
3、 ... and 、 Use tools to test
1、Poster For the usage of tools, see
http://note.youdao.com/share/?id=a3efa149d165258710ebf1bd04079f72&type=note
2、 Use Jmeter Interface test
First of all, let's talk about why Poster After the test, we need to use Jmeter Do interface tests , In use poster When testing, we will find that it is an interface to interface test , The data after each successful test , It can't be saved in tools , When we test again, we need to re-enter the test data , When we test an interface, it may not feel obvious , But when you test dozens of interfaces , You will find the use of Jmeter The benefits of , If the smoke test is conducted according to the test stage, we use poster, Integration testing we use Jmeter
Four 、 Use Jmeter The interface test
1、 First, add a thread group to the mail , Here we rename InterfaceTest
2、 Add a... To the thread group Http Default request , And configure the IP Address and transmission code
3、 Add a... To the thread group HTTP request , Here we rename “ Add credit card account information interface ”
4、 Configure interface request information , This configuration example is as follows :
5, When saving the credit card bill interface request , Examples are as follows :
notes : because Jmeter Requests within a thread group are executed from the first , So we put the request that needs to be executed first
6、 Add listeners to thread groups , Look at the result tree and aggregate report
7、 Click start , Check... After running , Result tree and aggregation report
8、 Check the data in the database
9、 Mass data manufacturing
Ideas :
1)、 Parameterizable parameters , Interface for saving credit card account information (clientNo,cardNo), Save credit card bill interface (clientNo,cardNo,billMonth,paymentDate)
2)、 The dependencies of the two interfaces , Save credit card bill interface (clientNo,cardNo) Interface with credit card account information (clientNo,cardNo) The two of are the same , That is to say, these two need a parameter , And it cannot be repeated
According to the above two characteristics ,(clientNo,cardNo) We choose to use counters , The counter is incremented once per cycle 1, Then we set the thread group to execute circularly 1 Ten thousand times ;billMonth,paymentDate, We use random functions for these two dates ${__Random(1,9,)}, Parameterize the month ;
3)、 Create counters on thread groups , The configuration is as follows :
4)、 Reference counters and random functions
The credit card account interface passes in parameters
args={
"clientNo":"${add}434343556",
"alias": "** The credit card 2",
"cardName": " The Great Wall ***** card 2",
"cardNo": "${add}25622356788251",
}
The bill interface passes in parameters
args={
"clientNo":"${add}434343556",
"accountName": " test ",
"billDate": "08",
"billMonth": "20150${__Random(1,9,)}",
"cardNo": "${add}25622356788251",
"currentPayment": " arrears 459.80",
"paymentDate": "2015-0${__Random(1,9,)}-25 09:00:00",
}
5)、 Set up thread group loop test , Click on the run , View the run results , Go to the database again , Large quantities of data are thus generated
边栏推荐
- JSON Library Tutorial from scratch (II): parsing digital learning and sorting notes
- Click to jump out and drag the pop-up window
- Install pytorch through pip to solve the problem that torch cannot be used in jupyter notebook (modulenotfoundererror:no module named 'Torch').
- Personalized Federated Learning with Moreau Envelopes
- Duplicate symbols for architecture i386 clang
- 1.6.3 use tcpdump to observe DNS communication process
- TX Text Control 30.0 ActiveX
- 2021-03-23
- MySQL prevents Chinese garbled code and solves the problem of Chinese garbled code
- Pointer array function combination in C language
猜你喜欢

Common cluster deployment schemes in redis

TX Text Control 30.0 ActiveX

Flex flexible layout for mobile terminal page production

Dynamic programming example 2 leetcode62 unique paths

Mirror image of binary tree

Essais de pénétration - sujets d'autorisation

Rce code execution & command execution (V)

Professional things use professional people

Specific operations for uploading pictures in PHP

CTFHUB SSRF
随机推荐
TX Text Control 30.0 ActiveX
C language -- Sanzi chess
2022.1.23 diary
CSRF (Cross Site Request Forgery) &ssrf (server request forgery) (IV)
2022.1.21 diary
C style string
Five simple data types of JS
2022.1.25
Large number operation (capable of square root, power, permutation and combination, logarithm and trigonometric value)
Professional things use professional people
JS handwriting depth clone array and object
How to choose the years of investment in financial products?
IronOCR 2022.1 Crack
Essais de pénétration - sujets d'autorisation
Instant messaging project (I)
Eyeshot Ultimate 2022 Crack By Xacker
First blog
Database low-end SQL query statement fragment
Bind simulation, key points of interpreting bind handwritten code [details]
Database query optimization method
