当前位置:网站首页>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
边栏推荐
- 2022.1.21 diary
- H5 native player [learn video]
- I got to know data types and function variables for the first time. I learned data types and function variables together today and yesterday, so I saved them in the first issue to record.
- C language -- Sanzi chess
- SRC platform summary
- How to choose the years of investment in financial products?
- JS function to realize simple calculator
- Go deep into the working principle of browser and JS engine (V8 engine as an example)
- Ctfhub eggs
- Creation and use of MySQL index
猜你喜欢

How micro engine uploads remote attachments

Unsupervised domain adaptation in semantic segmentation:a review unsupervised domain adaptation in semantic segmentation: a review

February 20ctf record

Notes on non replacement elements in the line (padding, margin, and border)

Small sample learning data set

Eyeshot 2022 Released

Detailed summary of flex layout
![[day40 literature extensive reading] space and time in the child's mind: metallic or atomic](/img/98/10b3e63c9609990c51b619d9ca6179.jpg)
[day40 literature extensive reading] space and time in the child's mind: metallic or atomic

BUUCTF(web:1-50)

Common cluster deployment schemes in redis
随机推荐
Penetration test - right raising topic
Can bus extended frame
Ranorex Studio 10.1 Crack
[OSPF routing calculation (class I LSA router, class II LSA network, and class III LSA sum net)] -20211228-30
On Transform
2.20 learning content
IronOCR 2022.1 Crack
SSRF-lab
Five simple data types of JS
Handwritten promise all
Instant messaging project (I)
H5 canvas drawing circle drawing fillet [detailed explanation]
Activereportsjs V3.0 comes on stage
Specific operations for uploading pictures in PHP
The article is on the list. Welcome to learn
HR took the initiative to raise the salary of the test lady. How did she do it?
CTFHub-rce
Read the general components of antd source code
Native JS high risk reminder pop-up code snippet, "are you sure you want to do this?" and "it cannot be recovered after deletion. Do you want to continue“
Example of dynamic programming 3 leetcode 55
