Pom, Chinese: Page object model, Pom is a very popular in recent years, automated test model, or thought, POM is not a framework, is a solution to the problem of the idea.
With POM objective: To solve the UI changes frequently in the front end, resulting in the cost of test automation script maintenance more and more expensive
Pom idea: Separate page elements from business logic and test scripts into two different class files. Class A only writes page element positioning, and the business logic code operation of the package, Class B write only Test script,
Do not care about element positioning, write only call Class A code to cover different test scenarios, if the front page changes, only need to modify the class A element positioning, and do not need to modify the test script code in Class B.
Pom mainly has the following advantages:
1. Detach the Web UI object repository from the test script, separating the business code from the test script.
2. Each page corresponds to a page class, and the elements of the page are written to this page class.
3. The page class mainly includes the element positioning of the page, and the method encapsulated by the business operation code associated with those elements.
4. Code reuse, which reduces the amount of test script code.
5. Clear hierarchy, while supporting the development of multiple writing automation scripts, such as how many pages each person writes, does not affect others.
6. It is recommended that both the page class and the business logic approach give a meaningful name to make it easy for others to quickly write scripts and maintain scripts.
A design idea in the framework design of "Python+selenium Building automation Framework"--pom