Module-driven testing for UI automated testing


Preface

`The most classic mode in UI automated testing is module-driven testing. Its essence is to encapsulate repeated operations into a public module, and then call the public module when encapsulating the page to simplify the code and eliminate the writing of repeated code to the greatest extent, thus greatly improving development efficiency. At the same time, it also simplifies the work of code maintenance. Only the public modules need to be modified for changes.

This article uses the login page to briefly describe module-driven testing, hoping to inspire everyone.


1. Preparation work

1. The existing login page is as shown below:
Network diagram, intrusion and deletion

2. The UI automation framework directory of the PO model has been built in pycham.

2. Usage steps

1. Create a python file under the base package and encapsulate the basic operations of the UI into a public class

Encapsulate public base classes

2. Call the public module when encapsulating the page

To analyze the login page, you need to perform the following operations:
enter the user name, enter the password, and click the login button
. Each operation is encapsulated into methods in turn, and the corresponding methods of the public module are called.
Insert image description here


Summarize

The above is what I will talk about today. This article only briefly introduces the module-driven application of UI automated testing. If you have better opinions or opinions, please leave a message to discuss.

Guess you like

Origin blog.csdn.net/liangxiaoyan0426/article/details/130869071