How to do automated testing? Automated testing difficult questions + answers, advanced advanced testing...


foreword

What is your automation (use case execution automation) process like?

1. Make a test plan (clear test scope-automation feasibility, layered test, test purpose-functional, non-functional, test content-requirements, methods, resource and manpower requirements)

2. Review
3. Analyze test requirements (transform requirements into test requirements), clarify test points, and give priority to relatively stable and relatively important modules in the design project.
4. Design test cases
5. Build an automated test framework
6. Write test scripts and script specific test cases (including preparation, execution, assertion, and cleanup) 7. Execute tests 8. Obtain test results 9.
Track
defects
10.
Continuous integration (a complete continuous integration system includes: an automatic construction process, including automatic compilation, distribution, deployment and testing)

What problems do you encounter in automated testing?

Test scripts have too much repetitive code and are difficult to maintain. Introduce PO model, parameterization.
The platform under test is unstable, often causing element positioning failures

Common use cases for automated testing?

Regression testing: quickly verify whether new defects are introduced through automated testing, and whether old defects are successfully repaired Smoke testing: run a round of automated testing
before manual testing to ensure that there is no problem with the main process of the project Automated testing can
also be used when a large amount of data needs to be generated Coverage of program logic flow and control flow by use case sets


If you are allowed to lead from zero, how to carry out automated testing?

Preliminary preparation:
Evaluate whether the project under test is suitable for automated testing (what kind of project and team are suitable for automated testing?)
Evaluate which functional modules of the tested project are suitable for automated testing (what kind of functional modules are suitable for automated testing?)

Determine which testing tools and testing frameworks to use.
Evaluate what resources are needed to carry out automated testing, including: personnel, machines, time;
resources that are currently available or can be applied for;
how to carry out automated testing without affecting daily testing work;

Start the automated testing work:
determine the development principles of the automated testing framework;
build the automated testing framework;
determine the writing principles of the automated test cases
; filter and review the use case sets that can be converted into automated test cases according to the functional test cases; write
automated test cases;
review automated test cases;
write automated test scripts
; debug automated test scripts
; run automated
test scripts;

Later work:
Improve automated test cases;
regularly adjust automated test scripts and frameworks according to actual conditions;
integrate CI, execute automated test scripts regularly, and automatically send test results to colleagues' mailboxes;

How to choose an automated testing framework/tool?

Preliminary distinction based on test types:
interface automation testing; UI automation testing; performance testing;

Interface automated testing:
tools: postman (beginner), jmeter (advanced),
if you need to combine code, it is recommended to use jmeter.
Code: Python + Requests + unit testing framework (Unittest, Pytest), Cypress, HttpRunner, RobotFramework

UI automation testing:
App side: Appium, Airtest, RobotFramework
Applet: MiniProgram
Web side: Selenium, Cypress, RobotFramework
Window side: Cypress (electron framework application), Airtest

Performance testing:
Jmeter (open source, secondary development)
Loadrunner (paid)

What might be wrong with the automation script?

The configuration environment causes:
the configuration of the automated test script;
the configuration of the test program. Such as: whether to restore the initial settings, whether to delete some data.
Configure the browser;
configure programs related to the test program or programs that affect the stability of the script;

Caused by non-configuration environment:
network delay, synchronization problem of recognized objects;
unknown factors cause script failure;
unknown factors cause script interruption;
automation script itself uses unstable factors;
script inheritance, the failure of the previous script leads to the failure of the next script.

Improve script stability?

Improve the stability of the script:
it must meet the stability requirements and be compatible with different environments and platforms.
Stability means that automated scripts can be reused and the script does not report errors, except for system errors.
Compatibility means that it can run on different platforms and environments

Solution:
In order to be able to run the script repeatedly, data cleaning should be performed before running and after running, which is divided into pre-cleaning and post-cleaning;

The data should not be written to death as much as possible. The cured data is easy to be modified by others. Try to make the current execution unit configurable for data and achieve centralized maintenance. It can also be dynamically generated by relying on other interfaces, so as to avoid the failure of the original hard-coded data;

Script exception handling, adding a failure rerun mechanism, if a failure occurs, set the number of retries;

Improve the stability of the environment, including the stability of its own environment and the stability of the third-party system environment (the test environment is separated, and the operating environment can be flexibly configured);

The file paths in Windows and Linux environments need to be compatible, because the methods of obtaining file paths in the two systems are inconsistent;

Exception capture processing, exception skipping, or marking;
ensure the integrity and independence of use cases, can be coupled, and can run independently;
interfaces that rely on third-party services need to set a reasonable timeout period;
continuous verification, maintain a certain operating frequency, such as daily inspections, etc., to avoid long period of maintenance due to long-term non-running and insufficient maturity of its own scripts.

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)

No matter how many setbacks you encounter, the dream in your heart is always the driving force for moving forward, and hard work is the cornerstone of achievement. Persist in struggle, ignite the fire in your heart, live up to your youth, pursue your own light, and bloom a chapter without regrets on the brilliant stage!

Go forward bravely, regardless of the result, only for the persistence of hard work and hard work; although the road of struggle is tortuous, the growth and benefits harvested will always be beyond imagination. Believe in your own strength, dare to chase your dreams, create brilliance with sweat, and write an immortal legend!

No matter what the starting point is, as long as you have the pursuit and perseverance, every effort is a step towards success. Face difficulties bravely, without fear of failure, write your own glorious chapter with passion and persistence, and let struggle become the most beautiful melody of life!

Guess you like

Origin blog.csdn.net/shuang_waiwai/article/details/131918170