Crazy harvest offer, the most complete interface test interview questions + answers in the whole network, interview must brush questions...


foreword

Interview question: What is the interface testing process of your company?

We did the interface test in the XX project, mainly including XX interface, XX interface, XX interface and so on.
1. First, get the API interface document from the developer to understand the interface business, including interface address, request method, input parameters, output parameters, token authentication, return format and other information.

2. Then use Postman or Jmeter tools to perform interface testing. Generally, the steps to use Jmeter are as follows:

First create a new thread group.
Then it is to create a new HTTP request default value. (Enter the interface server IP and port);
create a lot of HTTP requests, one request for one use case. (Enter the interface path, access method, parameters, etc.)
Then create an assertion and view the result tree.
Finally debug and execute the use case, and finally write the interface test report

In fact, we also encountered quite a lot of problems when we made the interface, and we solved them independently, such as garbled return value (modify the configuration file of jmeter to UTF-8 encoding), such as the need to log in to obtain the token authentication code and This authentication code needs to be used in the following request (use the regular expression extractor to extract the token value, etc.

Interview question: Please briefly describe the difference between cookie, session and token?

Cookie data is stored on the client's browser, and session data is stored on the server. The token is the authentication code for the interface test. Generally, the token can only be obtained after logging in, and then the token parameter needs to be brought every time the interface is requested.

Cookies are not very secure. Others can analyze cookies stored locally and cheat cookies. Considering security, sessions should be used, and sessions will be saved on the server for a certain period of time. When the number of visits increases, it will take up more performance of your server. Considering reducing server performance, cookies should be used

Important information such as login information can be stored as a session; other information needs to be saved, which can be placed in a cookie

Interview question: How to design test cases for interface testing? (must ask)

Interface testing generally considers changes in the form of input parameters and the business logic of the interface. Generally, the design of interface test cases adopts the equivalence class, boundary value, and scenario methods!
The idea of ​​interface test design test case is as follows:

Interface business logic test? (Positive example)
Interface logic test refers to the output value obtained under normal input conditions according to the description of business logic, input parameters, and output value;

Whether the test is correct, that is, to test whether the interface services provided to the outside world are working normally.

Module interface testing? (Counterexample)
The module interface test is to ensure the safety of the data and the correctness of the logic of the program under abnormal conditions.

The module interface test mainly includes the following aspects:
authentication code token exception (authentication code is empty <no authentication code>, wrong authentication code, expired authentication code).
Other parameters are abnormal.

Mandatory items check:
parameter length, type, format exception:
general parameters: (number, string, date)
parameter length: 6-18 digits. Or ID card, phone length.
Parameter types: numbers (precision), letters, Chinese, parameters with spaces, special characters.
Date format: date: year, month, day, year, month, day, hour, minute, second, date format (including /,-,:, etc.).

Error code exception coverage.
Interface testing other concerns

When the interface has page turning, the abnormal value test of the page number and the number of pages
is added, deleted, modified, and checked in the database. For example, after a post interface operation is completed, check whether the new data is consistent with the previous post through the list page interface

Whether the image address returned by the interface can be opened, and whether the size of the image meets the requirements;
when the output parameters are linked, it is necessary to verify whether the actual results returned by the two parameters meet the requirements;
all list page interfaces must consider the sort value;
all functions must Consider compatibility with older versions;

Interview question: Do you compare databases during interface test execution?

Sure, because the data returned by the interface comes from the database, and the operation of the data on the interface needs to perform in-depth database checks!

Interview question: What are the response status codes?

1xx: Instructions – Indicates that the request has been accepted, continue processing
2xx: Success – Indicates that the request has been successfully received, understood, and accepted
3xx: Redirection – Further operations must be performed to complete the request
4xx: Client Error – The request has a syntax error or Request Unfulfilled
5xx: Server-Side Error – The server failed to fulfill a legitimate request

Interview question: Are there many bugs found during interface testing? Can you give some examples?

This question is actually very simple to come back to. As long as you have done interface testing, you can always find a few bugs. Just say 2-3 bugs you usually find.

The interviewer asks this question mainly because he wants to know whether you have really done interface testing. After all, many friends’ resumes are fake now (if you don’t write it, you probably won’t have an interview opportunity. There is no way, in order to survive, you can understand)

For example, in the cash withdrawal input box, if you enter a negative number on the page, you will definitely not be able to submit it (the front-end page will judge the amount). If I don’t go to the front-end, I will directly use the interface tool to send a request and enter a negative number. (Assuming that the server does not judge the withdrawal amount data) Balance = current balance (100) - withdrawal amount (-100), then withdrawal -100, the balance becomes 200, that is, the more withdrawals, the greater the balance.

Interview question: What test points should be paid attention to in interface testing?

The image address is returned in the interface, and it is necessary to manually test the image (size, content);
when the interface completes the query function, the data returned is sorted and displayed;
when the interface is tested, pay attention to the default value and required items of the parameters;

Interview question: After the interface executes the test and returns the results for comparison, which part of the content is generally compared?

What must be compared before is to return the status code, and then compare and return other key content

Interview question: Have you ever used a packet capture tool before? How is it used?

I used the fiddler packet capture tool in the project before to capture HTTP protocol requests.

After opening fiddler, the default browser is configured with a proxy on port 127.0.0.1 8888. After fiddler sets the filtering policy, open the website that needs to capture packets and operate, and then you can capture packets.

Interview question: How to use jmeter for interface testing in the project?

Set the number of thread groups to 1, and the number of cycles to 1;
configure the global variable URL to add through the configuration element—user-defined variable;
add the default value of the configuration element http request, and place it after the user-defined variable;
add a transaction controller Manage and organize test cases;
add http requests in transaction control to add interface request information in test cases;
add corresponding assertion elements for assertion;

Interview question: How to set assertions in jmeter?

Right-click Request—Assertion—Response Assertion—Response Assertion Interface Input the items to be checked and compared. After setting the assertion, execute the interface test. If it passes, there will be no prompt when viewing the result tree. If the assertion fails, there will be red error. If the data returned by the interface is json data, you can also add json assertion

Interview question: How to implement association in jmeter?

First intercept the parameter value required by the next interface from the previous interface through the regular expression extractor or jsonpath parser and save it to a variable, and then use ${variable name} to get it when writing an interface

Interview question: What are the ways in which jmeter parameterization can be realized?

Configuration elements - user-defined variable elements can set global variables;

In the function assistant dialog box, you can choose random strings, random dates, and random numbers as parameters;
you can use csv files as parameters, and set them through the csv data set config component in the configuration component;

The following is the most complete software test engineer learning knowledge architecture system diagram in 2023 that I compiled

1. From entry to mastery of Python programming

Please add a picture description

2. Interface automation project actual combat

Please add a picture description

3. Actual Combat of Web Automation Project

Please add a picture description

4. Actual Combat of App Automation Project

Please add a picture description

5. Resume of first-tier manufacturers

Please add a picture description

6. Test and develop DevOps system

Please add a picture description

7. Commonly used automated testing tools

Please add a picture description

Eight, JMeter performance test

Please add a picture description

9. Summary (little surprise at the end)

Don't let past failures hold you back, because every effort is a breeding ground for opportunity. Write your own chapter of struggle with confidence and courage, overcome difficulties, and chase your dreams.

Don't be afraid of challenges, because the strength cultivated in adversity is immeasurable. Don't be greedy for ease, let go to chase the dream in your heart, and water hope with sweat. Believe in your own strength and persistence, go forward bravely, create your own brilliant life, and let your life bloom brilliantly.

On the bumpy road, don't shrink back, but keep fighting. Even in the face of setbacks and tribulations, we must maintain confidence and courage. Believe in your ability and potential, go forward bravely, create your own brilliant life, create an immortal legend, and bloom the splendid chapter of life.

Guess you like

Origin blog.csdn.net/x2waiwai/article/details/132064874