Explosive liver finishing, Web/interface automation test selection + supporting framework, a high-speed article...


foreword

Interface automation selection

Technology selection for interface automation: Python+Requests+Pytest+Allure, send and process HTTP protocol request interfaces through Python+Requests, use Pytest as the test executor, and use Allure to generate test reports.

The entire framework is divided into modules such as request method encapsulation, HTTP/HTTPS interface encapsulation, Python interface, business keyword encapsulation, test cases, test data, assertions, tool classes, test reports, and Jenkins continuous integration.

First, use Python to encapsulate the HTTP interface into a Python interface, then assemble these Python interfaces into keywords one by one, and then assemble the keywords into test cases, and then run these scripts through the Pytest test executor, and combine Allure to output test reports. Then perform Jenkins continuous integration for interface automation.

1) Introduction to Request
The Request library is a Python library used to send HTTP/HTTPS requests and receive HTTP/HTTPS responses. It is often used to test the Web API interface of the network service system, because the messages of the Web API interface are basically transmitted through the HTTP/HTTPS protocol.

2) Introduction to Pytest
Pytest is another third-party unit testing library for Python. Its purpose is to make unit testing easier, and it can also be extended to support complex functional testing at the application level.

3) Introduction to Allure
The Allure framework is a flexible lightweight multilingual test reporting tool. It not only displays brief test results in the form of web, but also allows everyone involved in the development process to extract useful information from the daily execution of the test to the greatest extent.

From the perspective of dev/qa, the Allure report simplifies the statistics of common defects: failed tests can be divided into bugs and interrupted tests, and logs, steps, fixtures, attachments, timing, execution history, and integration with TMS and BUG management systems can also be configured. Therefore, through the above configurations, all responsible developers and testers can grasp the test information as much as possible.

4) Jenkins continuous integration

WEB automatic selection

Selection of UI automation testing technology: Python+Selenium+Pytest+Allure. Selenium is an automation framework for web applications. Through it, we can write automation programs and operate the web interface in the browser.

1) The environment installation of selenium needs to install the client library & install the browser driver
python language, and install the selenium client library: pip3 install selenium
browser driver is matched with the browser. It is recommended to install chrome and the driver of chrome, and the official address of chrome is recommended

Browser compatibility testing requires the installation of other browsers and corresponding browser drivers.

2) Five steps of UI automation
① Obtain
the eight common element positioning methods used by selenium
Positioning by id: find_element_by_id(); positioning
by name: find_element_by_name(); positioning by tag: find_element_by_tag_name(); positioning by class: find_element_by_class_name( ) ; ); locate by link: find_element_by_link_text(); locate by partial_link: find_element_by_partial_link_text(); locate by xpath: find_element_by_xpath();





②Operating elements
After getting the element, the code will return the corresponding WebElement object of the element, through which the element can be operated

There are several common operation elements:
click on the element;
enter a string in the element, usually an element such as an input box;
or the information contained in the element, such as text content, attribute of the element;

③Integrate pytest, automate model selection with the same interface
④Manage test data, automate model selection with the same interface
⑤Allure generates automated test reports, automate model selection with the same interface
⑥Jenkins continuous integration, automate model selection with the same interface

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)

Work hard, not afraid of hardships, victory and challenge. On the road of overcoming thorns and thorns, unremitting efforts will surely open a new chapter in your life. Believe in your own abilities and bravely pursue your dreams. As long as you don't stop, success will not be far away! come on!

As long as you have faith, work hard, and persevere, you will be able to welcome the dawn of success. No matter how rough the road ahead is, as long as you go forward bravely, you will be able to create your own brilliance. Believe in your ability, bravely chase your dreams, and the future will dance with you!

Persist in the pursuit of dreams, not afraid of difficulties and challenges; only by working hard can we surpass ourselves. Keep your feet on the ground and go forward bravely, and you will be able to sail to the other side of success. Believe in yourself, unleash your inner strength, and become the master of the future! If you don't give up, there is a possibility of victory!

Guess you like

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