[Automated testing] Is it necessary to do automated testing?

‍Directory

I. Introduction

2. Purpose of automation

3. Automatic classification

4. Realization of automation

 

I. Introduction

In some test exchange groups, I often see small partners asking, "How to do automated testing? Is there any information on learning automated testing? Is automated testing awesome?", and some even say "testers who can't automate , are you really going to be eliminated?"

It has to be said that a bunch of traffic account owners grasp the public psychology, and those who click in must be advertisements for selling courses, or follow the WeChat official account to receive a big gift package of test materials.

To be honest, I had the same question before, even with concern. Every time I am unwilling to receive a big gift package of test materials......

Of course, with the continuous expansion of my cognition and the continuous improvement of my own test system , these worries gradually disappeared. Each technical reference depends on the applicable scenario, whether it is suitable for your own team, and only by adapting to local conditions can it exert its greatest value.

Therefore, I would like to share my understanding of automated testing through this article.

2. Purpose of automation

Automated work can save a lot of manual operation costs, reduce manual repetitive operations, and improve the research and development efficiency of the entire team. However, if it takes a long time to build an automation system and a lot of human resources are invested, but the user only needs 2-3 minutes of manual work to solve it, and this operation is infrequent, or the iteration of platform changes that require automated operations is very fast and there is no According to the law, automated tools follow behind like tiring work. So is automation still necessary?

In the team I was in before, it was very difficult to create test data, which seriously affected the entire R&D efficiency, but there was no good solution at that time. Later, the basic R&D team built a number creation platform. This platform needs to configure various fields by itself. And sort out the association of each table field, build the scene one by one from beginning to end, if you accidentally make a configuration error, you can't find the reason even if you look at the prompt. This adds another obstacle to the process of making numbers, and it takes a lot of time for the insufficient testing time.

If you can evaluate the input and benefits of the task before performing the task, can you carry out the task more reasonably. So what are the investment and benefits of automated testing?

Investment: Through testers using scripts or tools to automate and maintain the automation platform.

Benefits: Improve testing efficiency and improve the growth of testers.

Does automated testing really improve testing efficiency? Can it really improve the growth of testers? For the latter, I think there are. Next, let's talk about whether automated testing can improve testing efficiency.

3. Automatic classification

Automation is generally divided into interface automation and UI automation. UI automation is further divided into Web UI automation and App UI automation. According to my understanding, deployment automation should also be added.

  • interface automation
  • Deployment automation
  • Web UI automation
  • App UI Automation

Next, I will give an introduction to these four automated scenarios. Because I am not very familiar with UI automation, I think the input-output ratio is not very high, mainly because I have not been in contact with it, so I will only give a brief introduction later, focusing on interface automation and deployment automation.

4. Realization of automation

4.1. Interface automation

interface

Interface testing is mainly used to detect the interaction points between external systems and internal subsystems. The focus of the test is to check the exchange of data, the transfer process, and the mutual logical dependencies between the systems.

process

Fill in the interface, enter the parameters, assert the output parameters, build regularly every day, and output the test report.

Input parameter coverage: required, optional, yes/no/null, type, value size/value range, special characters;

Output parameters: json, data;

Interface association: dependency between interfaces, data transfer;

Assertion: To verify the response, you can verify the status code or msg.

advantage

Interface testing can cover more scenarios;

Interface testing can find server-side problems faster;

Interface testing is relatively easy to automate continuous integration ;

Interface testing is closer to business scenarios than unit testing;

Technology Selection

1、MeterSphere

MeterSphere is a one-stop open source continuous testing platform , covering functions such as test tracking, interface testing, performance testing, and teamwork, and is fully compatible with open source and mainstream standards such as JMeter, Postman, and Swagger.

MeterSphere is a full-featured platform and is open source. The free version is enough for small teams to use. The threshold for use is relatively low, and it does not require high technical skills, so it is a good choice. The technology stack used by MeterShpre is SpringBoot+vue, as well as some middleware , which can also be used for secondary development on this basis.

You can refer to the MeterSphere financial company landing experience shared by my previous team members , which introduces in detail the testing pain points solved by MeterSphere, as well as the operation tutorial.

2、Python

For interface automation through Python, common components include: execution library Requests, assertion library unittest, test report HTMLTestRunner, and continuous integration of Jenkins for regular construction.

Framework idea: encapsulation, data-driven.

If you use Python, you need to master certain coding skills. Of course, this is very helpful for improving personal skills, but if the time is tight and you don’t have enough technical skills, MeterSphere is still recommended.

4.2. Deployment automation

deploy

Deployment is to compile the source code into an executable software package, such as jar package or war package, and put the software package into the target environment, run the software package, and be able to be invoked by the client.

process

Pull the code through the remote warehouse, compile the front end, compile the back end, deliver the software package to the target machine, restart the service, and alarm if the startup fails.

advantage

Compared with traditional manual deployment, it is faster, less prone to errors, and improves delivery efficiency.

Technology Selection

gitlab or gitee: code hosting

git: version management

node: front-end compilation

maven: backend compilation

ansible: send files

shell: restart service

pipeline: pipeline construction

Jenkins: CICD manager, integrates the above tools and provides pages for users to operate the deployment process.

4.3. Web UI automation

UI automation

Locate the element through page element positioning, and simulate the user's operation behavior, click, input, drag and drop, etc.

process

Locate elements, simulate user actions, and send test reports.

advantage

It is suitable for scenarios that return to the main process and do not change frequently. Can be used for repetitive functional testing and verification. The team I was in before did a piece of Web UI automation, but because of frequent changes in requirements and limited energy, the cost of maintaining this platform was relatively high, and there was no continuous maintenance in the future.

Technology Selection

Python, selenium.

4.4. App UI automation

UI automation

Locate the element through page element positioning, and simulate the user's operation behavior, click, input, drag and drop, etc.

process

Locate elements, simulate user actions, and send test reports.

advantage

It is suitable for scenarios that return to the main process and do not change frequently.

Technology Selection

App.

Conclusion: I think that interface automation and deployment automation can bring benefits, can really improve efficiency, and can also bring growth to testers.


Finally, I would like to share with you my "Learning Route for Automation Test Engineers"

1. Essential Python programming content for automated testing

 2. Basic content of Web UI automated testing

 

3. Web UI automated testing content

 

4. Basic content of APP UI automation testing

 

5. Practical content of APP UI automation testing

 

6. Basic content of API interface automated testing

 

7. Practical content of API interface automated testing 

 

8. CI/CD continuous integration special technology

 

9. Practical technology of automated testing framework

 

Finally, I would like to thank everyone who has read my article carefully. Reciprocity is always necessary. Although it is not a very valuable thing, you can take it away if you need it:

These materials should be the most comprehensive and complete preparation warehouse for [software testing] friends. This warehouse has also accompanied tens of thousands of test engineers through the most difficult journey. I hope it can help you too! 

Information acquisition method:


 

Guess you like

Origin blog.csdn.net/qq_56271699/article/details/131263624