How to write interface test scripts? It's actually very simple to teach you in one minute


Fans chatted on QQ last week. I recently went to an interview and was asked "How to write interface test scripts". His answer was based on "Interface test documentation", but the interviewer said that the answer was not very good, so he should respond to this How should we answer the question?

Interpretation

Faced with the interviewer’s question, we can’t just guess. If there is something we don’t understand, we must communicate boldly. Only through continuous back and forth communication can we clarify the topic, so that we can answer more accurately.

As far as the question itself is concerned, we need to find a main thread to answer this question, just like writing an essay, you need to have a central idea. When most of my friends are answering, they just put things together, thinking about what to say, so it feels confusing to the interviewer. So what kind of main line should be used to answer the question? In fact, it is very simple. It is to answer with the interface test process as the main line . This has the advantage of clear logic, clear key points, and no confusion. Okay, then let's get up and take a look~

1 Be familiar with the tested interface and determine which interfaces need to be tested based on the requirements. It should be noted here that the function, performance, and safety interface tests will be somewhat different. The most basic is that the function needs to be tested in the forward and reverse direction, and the performance is tested in the forward direction.

2 After the tested interface is determined, the script should be written according to the interface document. Here you can also review a few knowledge points, one is what information needs to be provided in the interface document (for example, information header, request parameter format, etc.); the other is what form the interface document can provide (for example, swagger, etc.).

3 Interface test script writing. This is the core, and the interviewer is also concerned about this part. Generally, there are two major answers. One is through tools like postman and jmeter; the other is through a self-developed interface testing framework.

a. Take the first use of tools as an example to test, then you can answer from the use of the overall tool. For example, what components need to be built in jmeter, what do they do, what needs to be paid attention to, etc. Those who have used it should answer that there should be no big problems.

b. Taking the second self-developed framework as an example for testing, you need to describe the framework design structure, key points, and what functions can be achieved. For example, a combination of interface testing frameworks such as python, requests library, unittest, pytest, HTMLTestRunner, etc.

Roughly speaking from the above, the answer is more comprehensive, but the specific description requires more consideration. Here is just the idea of ​​answering the question.

4 Perform testing, including normal execution and regression testing. You can use external data to manage things like this one, because regression is definitely not all cases, so you only need to select the case that needs to be returned and execute the script.

5 Finally, a report is issued, and it's done! I want to talk about it here. I have seen reports generated directly using the framework in many places. This is not a problem in itself, but a test report is not only for the technology to see, it may also be viewed by the product or other colleagues, as well as senior leaders. It depends, so I personally suggest that a report that everyone can understand is required. This is also a way to reflect the value of the testing department.


Finally: a wave of software testing data sharing!

In the technology industry, you must improve your technical skills and enrich your practical experience in automation projects. This will be very helpful for your career planning in the next few years and the depth of your test technology mastery.

In the interview season of the Golden 9th and the Silver 10th, the season of job-hopping, organizing interview questions has become my habit for many years! The following is my collection and sorting in recent years, the whole is organized around [software testing], the main content includes: python automation test exclusive video, Python automation details, a full set of interview questions and other knowledge content.

May you and I meet and you will find something! If you want to exchange experience in software testing, interface testing, automated testing, and interviews. Follow WeChat public account:[Sad Spicy Strips]Receive a 216-page software test engineer interview book for free. And the corresponding video learning tutorials are free to share! Communication learning skirt:313782132

Recommend good articles:

Packaged as a test engineer with 1 year of work experience, my advice before the interview is as follows

What exactly should I learn in automated testing?

Why not consider Tencent for job-hopping? Talk about a little bit of the past between me and the goose factory

Which is more advanced, automated testing or manual testing?

Novice must see: How to write a qualified test case?

Python login interface test problem record and solution (dry goods)

Guess you like

Origin blog.csdn.net/weixin_50829653/article/details/114091047