A design idea in the framework design of "Python+selenium Building automation Framework"--pom

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.