当前位置:网站首页>Interface test interview questions and reference answers, easy to grasp the interviewer
Interface test interview questions and reference answers, easy to grasp the interviewer
2022-07-06 15:13:00 【Test Xiaowan】
Catalog
1、 What is the interface test process of your company ?
3、 Do you compare databases during interface test execution ?
4、 Talk to you about HTTP Understanding of the agreement ?
5、get and post What's the difference between requests ?
6、 What are the response status codes ?
7、 What test points should be paid attention to in interface testing ?
8、 Which part of the interface is compared with the returned test results ?
10、 Have you ever used a bag grabbing tool ? How to use ?
11、postman What is the use process ?
12、postman What's the use of setting environment variables in ?
13、 What is the connection ? how postman Set correlation ?
14、postman There are several ways to parameterize ?
15、jmeter What version is used ? How to install ?
16、 How to use... In a project jmeter Conduct interface test ?
17、jmeter How to set assertions in ?
18、jmeter How to implement Association in ?
19、jmeter add to http Request default value component function ?
20、jmeter How many parameterization methods can be realized ?
1、 What is the interface test process of your company ?
Interface test we are in XX The project did , There are mainly XX Interface ,XX Interface ,XX Interfaces, etc. .
1、 The first is to get it from the developer API Interface document , Understand interface business 、 Include interface address 、 Request mode , Enter the reference 、 The ginseng ,token authentication , Return format and other information .
2、 And then use Postman or Jmeter Tools perform interface tests , In general use Jmeter The steps are as follows :
- First, create a new thread group ;
- Then create a new one HTTP Request defaults .( Input interface server IP And port );
- Create many more HTTP request , One request, one use case .( Enter interface path , access , Parameters, etc. );
- Then create assertions and view the result tree .
3、 Finally debug and execute use cases. , Finally, prepare the interface test report .
4、 In fact, we also encountered many problems when we made the interface , They are all solved by themselves , For example, the return value is garbled ( modify jmeter The configuration file is UTF-8 Encoding mode ), For example, you need to log in to get token Authentication code, and this authentication code needs to be used in the following request ( Use the regular expression extractor to extract token And so on .
2、 sketch cookie、session And token The difference between
- cookie The data is stored on the client's browser ,session Data on the server . and token It is the authentication code during interface test , Under normal circumstances, you can get... Only after logging in token, Then you need to bring... Every time you request an interface token Parameters .
- cookie Not very safe , Others can analyze the local cookie And carry on cookie cheating , Should be used in consideration of safety session,session It will be saved on the server for a certain period of time . When visits increase , It will take up the performance of your server , Consider reducing server performance by using cookie.
- You can store important information such as login information as session; Other information needs to be saved , Can be placed in cookie.
3、 Do you compare databases during interface test execution ?
sure , Because the data of the returned value of the interface comes from the database , The data operation of the interface also needs to conduct deep-seated database inspection !
4、 Talk to you about HTTP Understanding of the agreement ?
Hypertext transfer protocol , Port is 80, characteristic ( No memory function 、 Fast ) It consists of a request and a response. The request header 、 Request line 、 The request body consists of ; The response is generated by the response header 、 Response line 、 The response text consists of , Before, our company's interface was https Agreed .
httpshttp+ssl Protocol port 443 Security oriented hypertext transfer protocol .
5、get and post What's the difference between requests ?
get and post Requests are all requests submitted by the client to the server ;
get Is the plaintext transmission parameter 、 Tend to request server resources . For example, open a website ;
post Transmission data is not visible , High safety , Tend to submit data to the server , Such as registration, etc .
6、 What are the response status codes ?
1xx: instructions -- Indicates that the request has been accepted , To continue processing ;
2xx: success -- Indicates that the request was received successfully 、 understand 、 Accept ;
3xx: Redirect -- Further action must be taken to complete the request ;
4xx: Client error -- The request has a syntax error or the request cannot be implemented ;
5xx: Server-side error -- The server could not fulfill the legitimate request .
7、 What test points should be paid attention to in interface testing ?
- Interface returned picture address , To test the pictures manually ( size 、 Content );
- When the interface completes the query function , Sorting display of data return ;
- When testing the interface , Focus on the default value of the parameter 、 mandatory .
8、 Which part of the interface is compared with the returned test results ?
What must be compared before is the return status code , Then compare and return to other key contents .
9、 Why do interface tests ?
- Interface testing belongs to integration testing 、 The sooner the test gets involved 、 The more problems can be found early in the project , The lower the cost of fixing the problem ;
- Interface testing is very fast 、UI Automate the execution of a test case 10S about 、 If the interface test case is executed , The time required is in milliseconds .
10、 Have you ever used a bag grabbing tool ? How to use ?
Used in the project before fiddler Grab tool HTTP Protocol request fetching .
open fiddler after , The default browser is configured with 127.0.0.18888 Port proxy , stay fiddler After setting the filtering policy , Open the website that needs to capture packets for operation , You can capture packets .
11、postman What is the use process ?
- Write use cases ;
- stay postman First build up url environment variable ;
- Create a new set management module according to the module to which the interface use case belongs ;
- Enter test cases under different modules in the collection ;
- When you enter test cases, you can enter them in... According to the expected results tests Add assertions in the tab ;
- Export through Newman To run .
12、postman What's the use of setting environment variables in ?
In previous projects , The interface testing environment includes development environment , Test environment, etc , For the convenience of testing , It's just postman Set the environment variable , At that time, all interfaces will reference the environment variable , In this way, it is not necessary to modify the host address of the tested system interface every time in order to switch the environment ; Click the environment variable management button in the upper right corner - New environment variable , Use... In scripts {undefined{ Variable name }} To call .
13、 What is the connection ? how postman Set correlation ?
Association is to intercept the part of the return value of the previous interface , As a parameter of the next interface , Can make the interface run in series .
stay postman The steps of setting Association in are as follows :
- First through the regular expression extraction method or json The value method intercepts the information required by the next interface from the previous interface ;
- Use the code that sets the global variable to save the extracted value to the global variable ;
- In the next interface , Use {undefined{ Global variables }} Replace the static value to be replaced .
14、postman There are several ways to parameterize ?
Built in variables 、pre-scripts To write js Script 、 Batch runtime import csv or json File format .
15、jmeter What version is used ? How to install ?
jmeter It's using 5.1.1 edition , Install as follows :
Install it on the computer first jdk1.8 Or above , Then download the latest installation package from the official website , After decompressing , Configure environment variables , After configuration, the installation is completed
16、 How to use... In a project jmeter Conduct interface test ?
- Set the number of thread groups to 1, The number of cycles is set to 1;
- Configure global variables URL By configuring components --- User defined variables are added ;
- Add configuration components http Request defaults , Placed after user-defined variables ;
- Add transaction controller to manage and organize test cases ;
- Add... To transaction control http Request to add the interface request information in the test case ;
- Add the corresponding assertion component to assert .
17、jmeter How to set assertions in ?
Right click request --- Assertion --- Response assertion --- In the response assertion interface, enter the items to be checked and compared , After setting the assertion , If the interface test is passed , There will be no prompt when viewing the result tree , If the assertion fails , There will be a red error . If the data returned by the interface is json data , You can also add json Assertion .
18、jmeter How to implement Association in ?
Start with the regular expression extractor or from the previous interface json path The parser intercepts the parameter values required by the next interface and saves them to the variable , Then write an interface through ${ Variable name } To get .
19、jmeter add to http Request default value component function ?
After adding and setting , Equivalent to giving all http Request samplers are set to default values , There is no need to fill in the host address in the sampler 、 port 、 Agent etc. , You can use http Request default settings .
20、jmeter How many parameterization methods can be realized ?
- The configuration element --- User defined variable components can set global variables ;
- In the function Assistant dialog box, you can select, for example, random string 、 Random date 、 Random numbers as parameterization ;
- have access to csv File as parameterization , By configuring csv dataset config Components can be set .
Thank everyone who reads my article carefully !!!
If you can use the following information, you can take it away directly :
1、 Self study development or test the necessary complete project source code and environment
2、 Test all templates in the work ( test plan 、 The test case 、 Test report, etc )
3、 Classic interview questions for software testing
4、Python/Java Automation test practice .pdf
5、Jmeter/postman Interface test full set of video acquisition
I personally sorted out some technical materials I have sorted out in my software testing career in recent years , contain : e-book , Resume module , Various work templates , Interview treasure , Self study projects, etc . Comments required .
边栏推荐
- Logstack introduction and deployment -- elasticstack (elk) work notes 019
- 软件测试面试回答技巧
- Maximum nesting depth of parentheses in leetcode simple questions
- Vysor uses WiFi wireless connection for screen projection_ Operate the mobile phone on the computer_ Wireless debugging -- uniapp native development 008
- Soft exam information system project manager_ Project set project portfolio management --- Senior Information System Project Manager of soft exam 025
- Pedestrian re identification (Reid) - data set description market-1501
- Sorting odd and even subscripts respectively for leetcode simple problem
- Leetcode simple question: check whether the numbers in the sentence are increasing
- CSAPP家庭作业答案7 8 9章
- Global and Chinese market of goat milk powder 2022-2028: Research Report on technology, participants, trends, market size and share
猜你喜欢
STC-B学习板蜂鸣器播放音乐
Maximum nesting depth of parentheses in leetcode simple questions
软件测试有哪些常用的SQL语句?
The maximum number of words in the sentence of leetcode simple question
几款开源自动化测试框架优缺点对比你知道吗?
The minimum sum of the last four digits of the split digit of leetcode simple problem
Cadence physical library lef file syntax learning [continuous update]
Eigen User Guide (Introduction)
[200 opencv routines] 98 Statistical sorting filter
线程及线程池
随机推荐
Example 071 simulates a vending machine, designs a program of the vending machine, runs the program, prompts the user, enters the options to be selected, and prompts the selected content after the use
UCORE lab7 synchronous mutual exclusion experiment report
软件测试有哪些常用的SQL语句?
Practical cases, hand-in-hand teaching you to build e-commerce user portraits | with code
[200 opencv routines] 98 Statistical sorting filter
Global and Chinese markets of cobalt 2022-2028: Research Report on technology, participants, trends, market size and share
[HCIA continuous update] advanced features of routing
ucore lab1 系统软件启动过程 实验报告
Threads and thread pools
China's county life record: go upstairs to the Internet, go downstairs' code the Great Wall '
Mysql database (II) DML data operation statements and basic DQL statements
Global and Chinese market of DVD recorders 2022-2028: Research Report on technology, participants, trends, market size and share
Which version of MySQL does php7 work best with?
Capitalize the title of leetcode simple question
Contest3145 - the 37th game of 2021 freshman individual training match_ A: Prizes
Install and run tensorflow object detection API video object recognition system of Google open source
Global and Chinese markets for complex programmable logic devices 2022-2028: Research Report on technology, participants, trends, market size and share
线程及线程池
Express
Global and Chinese markets for GaN on diamond semiconductor substrates 2022-2028: Research Report on technology, participants, trends, market size and share