当前位置:网站首页>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
边栏推荐
- Instant messaging project (I)
- Dynamic programming example 2 leetcode62 unique paths
- 3.2.3 use tcpdump to observe TCP header information (supplement common knowledge of TCP protocol)
- Charles and iPhone capture
- Common cluster deployment schemes in redis
- Deep analysis of epoll reactor code
- Eyeshot 2022 Released
- 2.20 learning content
- Detailed summary of position positioning
- Using JS to realize the sidebar of life information network
猜你喜欢

2022.1.21 diary

Create an environment for new projects

Use js to simply implement the apply, call and bind methods

Flex flexible layout for mobile terminal page production

HR took the initiative to raise the salary of the test lady. How did she do it?
![The k-th node of the binary search tree [sword finger offer]](/img/9c/26b508100d8b49c114cf72346a8e7c.jpg)
The k-th node of the binary search tree [sword finger offer]

Deep analysis of recursion in quick sorting
![[relax's law of life lying on the square] those poisonous chicken soup that seem to be too light and too heavy, but think carefully and fear](/img/12/d41f8d5abcb61d2632a8b117bf1604.jpg)
[relax's law of life lying on the square] those poisonous chicken soup that seem to be too light and too heavy, but think carefully and fear

UVA816 Abbott’s Revenge

Essais de pénétration - sujets d'autorisation
随机推荐
Mysql interactive_ Timeout and wait_ Timeout differences
First blog
Double recursion in deep analysis merge sort
Stack and Queue
Dynamic programming full backpack
Analysis of IM project framework
2.20 learning content
Common cluster deployment schemes in redis
2022.1.21 diary
Deep analysis of epoll reactor code
How to choose the years of investment in financial products?
Go Methods and Interfaces
Small sample learning data set
Example of dynamic programming 3 leetcode 55
A summary of the experiment of continue and break in C language
Large number operation (capable of square root, power, permutation and combination, logarithm and trigonometric value)
Essais de pénétration - sujets d'autorisation
HR took the initiative to raise the salary of the test lady. How did she do it?
Five simple data types of JS
Ranorex Studio 10.1 Crack
