当前位置:网站首页>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
边栏推荐
- Detailed summary of flex layout
- Attack and defense world web baby Web
- TeeChart Pro ActiveX 2022.1
- Page electronic clock (use js to dynamically obtain time display)
- Abuse unlimited authorization -- is your address safe?
- February 20ctf record
- Jason learning
- The article is on the list. Welcome to learn
- Implementation of websocket long connection by workman under laravel
- Keyboard key code value
猜你喜欢

Eyeshot 2022 Released

The article is on the list. Welcome to learn

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

Laravel's little knowledge

JSON Library Tutorial from scratch (I): starting to learn and organize notes
![[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

Ranorex Studio 10.1 Crack

Prototypical Networks for Few-shot Learning

滲透測試-提權專題

File upload vulnerability (III)
随机推荐
Pointer array function combination in C language
Go implements LRU cache
How to choose the years of investment in financial products?
JSON Library Tutorial from scratch (III): parsing strings, learning and sorting notes
Creation and use of MySQL index
Detailed summary of float
JSON Library Tutorial from scratch (II): parsing digital learning and sorting notes
CSRF (Cross Site Request Forgery) &ssrf (server request forgery) (IV)
Mobile number regular expression input box loses focus verification
The construction and usage of wampserver framework
Using JS to realize the sidebar of life information network
Bind simulation, key points of interpreting bind handwritten code [details]
Vue uses keep alive to cache page optimization projects
SQL lab range explanation
Eyeshot Ultimate 2022 Crack By Xacker
Array: force deduction dichotomy
BUUCTF(web:1-50)
Try block and exception handling
A summary of the experiment of continue and break in C language
PHP calls map API
