Super complete, Selenium4 automated testing parallel testing detailed explanation, the advanced road is enough to read this article...


foreword

Selenium4 automated testing: https://www.bilibili.com/video/BV1MS4y1W79K/

The commonly used selenium automated testing supporting framework:
Python+selenium4+pytest+POM+allure+Jenkins;

As technology advances and human testing turns to Selenium automated testing, testing solutions become more scalable than ever.

However, there is one more mountain in front of most teams: the scalability of parallel testing. Many companies are still using sequential testing methods to provide quality assurance, which consumes a lot of time, resources and effort.

What is parallel testing?

Parallel testing in Selenium is a process that runs the same test in different environments at the same time. The main purpose of executing tests in parallel is to reduce the overall time to improve testing efficiency while ensuring high quality product by using Selenium Grid. Let's test the sequential execution scenario.

Please add a picture description

Let's say I want to test the functionality of submitting a form, and I wrote an automated test script for that form.
If this test were to be performed on 60 different browser and OS combinations, and assuming a single test runs in 1 minute, it would take a total of 60 minutes, or 1 hour. This is just one use case, and it's scary to think about running automation scripts on other modules.

In the above case, what happens if you run 3 parallel tests at the same time:

Please add a picture description

The total execution time will be reduced from 60 minutes to 20 minutes. Likewise, if 4 parallel tests were run, the total time would only be reduced to 15 minutes, and so on, doubling and then doubling the efficiency.

Why run Selenium tests in parallel?

1. Wider test coverage
Executing tests in parallel is a faster approach compared to sequential testing as it provides testers with wider test compatibility with shorter spans.

For example, if you want to test the user interface functionality of a new web application, instead of running the tests repeatedly for different OS and browser combinations, you can test all combinations at the same time by running the tests in parallel.

2. Reduce testing time
Sequential testing does provide comprehensive and thorough automated browser testing for web applications, but it is very time-consuming. Parallel testing, on the other hand, can reduce overall test time by running tests in parallel on multiple computers.

For example, if you want to run 100 runtimes, you can increase the efficiency of automated browser testing by 100 times, helping you ship products faster.

3. Cost-effectiveness
Sequential testing requires development, maintenance and keeping the test environment up-to-date, which can affect the overall cost. But parallel testing in Selenium is an automated process that runs on the cloud, so it requires no maintenance. Plus, don't worry about updates because the cloud infrastructure is always updated.

4. Continuous integration and delivery
For continuous integration and continuous delivery, functional tests need to be run frequently and quickly. And by running tests in parallel, it not only saves more time, but also gets detailed test data reports. Development teams can later use these reports to find issues in the code and fix them quickly to optimize CI/CD.

5. Continuous Testing
A great way to release a high-quality product in the shortest possible time is to use continuous integration and delivery methods. Continuous testing requires faster testing cycles, which is not feasible for sequential automated browser testing. However, products can be released to the market faster if parallel testing is used in Selenium, allowing the team to take advantage of cloud technology and virtualization in software testing to execute more tests at a faster rate.

6. How to handle parallel test cases?
We think the best way to execute tests in parallel is to create different projects for browser compatibility testing to test various parts of the web application, and create a main project for testing these different projects. Generally, there are two levels of parallel testing criteria in selenium. The first is an entry-level condition and the second is an exit condition.

In the entry-level standard, specific tasks are defined that should be fulfilled before a test can be successfully executed in parallel, such as:

Test environment setup is required before starting parallel testing in Selenium;
preconditions and scenarios must be defined before starting the automated browser testing process;
new and old data must be migrated successfully;

Exit level criteria describe the steps to successfully perform parallel testing, including:
running the legacy system against the newly developed system;
understanding the differences between the two systems;
conducting a full cycle of automated browser testing using the same inputs;
comparing to the legacy system , measure the output of the newly developed system;
report bugs (if found) to the development team;

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)

Today's efforts are tomorrow's gains. As long as you don't give up the pursuit, you will have the opportunity to realize your dreams; the most important thing in life is not to succeed, but to keep moving forward; everyone has their own light, just be brave and shine; anyone All efforts will pay off, as long as you persevere; success requires a price, but persistence is the greatest victory.

Persistence is the key to victory in the pursuit of dreams. Every fall is an opportunity to grow, and as long as you don't give up, you can go further, higher, and faster. Believe in yourself, stick to your choice, you will definitely be able to make life better!

Only when you let go of your comfort zone and move forward bravely, can you discover your infinite possibilities; don’t let failure overwhelm you, because failure is the mother of success; firmly believe in your ability, bravely pursue your dreams, and success is beckoning to you!

Guess you like

Origin blog.csdn.net/m0_70102063/article/details/130988661