当前位置:网站首页>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 ?

2、 sketch cookie、session And token The difference between

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 ?

9、 Why do interface tests ?

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

  1. 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 .
  2. 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.
  3. 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 ?

  1. Interface returned picture address , To test the pictures manually ( size 、 Content );
  2. When the interface completes the query function , Sorting display of data return ;
  3. 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 ?

  1. 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 ;
  2. 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 ?

  1. Write use cases ;
  2. stay postman First build up url environment variable ;
  3. Create a new set management module according to the module to which the interface use case belongs ;
  4. Enter test cases under different modules in the collection ;
  5. When you enter test cases, you can enter them in... According to the expected results tests Add assertions in the tab ;
  6. 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 :

  1. First through the regular expression extraction method or json The value method intercepts the information required by the next interface from the previous interface ;
  2. Use the code that sets the global variable to save the extracted value to the global variable ;
  3. 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 ?

  1. Set the number of thread groups to 1, The number of cycles is set to 1;
  2. Configure global variables URL By configuring components --- User defined variables are added ;
  3. Add configuration components http Request defaults , Placed after user-defined variables ;
  4. Add transaction controller to manage and organize test cases ;
  5. Add... To transaction control http Request to add the interface request information in the test case ;
  6. 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 ?

  1. The configuration element --- User defined variable components can set global variables ;
  2. In the function Assistant dialog box, you can select, for example, random string 、 Random date 、 Random numbers as parameterization ;
  3. 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 .

原网站

版权声明
本文为[Test Xiaowan]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/187/202207060919129052.html

随机推荐