Page Object Model principles

Yesterday saw a testerhome open class, and some ideas on Page Object, although the open class not speak too thin, but also expressed some ideas, provided some design ideas, hoping to continue to explore in future work, the following share content

Page Object of several principles:

Methods meaning:

1. Public service approach represents a UI provided

The method should return PageObject or other data returned for asserting

3. The same behavior different results can be modeled in different ways

4. Do not add assertion within method

Fields meaning:

1. Do not expose internal to external page elements

2. do not need all the elements within the UI modeling

 

PO mode main constituent element of the package:

Page Object: to complete the package page

Driver Object: to complete the driver for Web, android, IOS, the interface

Test: call the Page object to achieve business and assertions

Data encapsulation: and the data driver profile

Utils: Other features package, insufficient development primary frame

 

BasePage wrapper classes, such as:

__init__()

find()

find_and_click()

handle_exception()

 

 

 

 

Guess you like

Origin www.cnblogs.com/sylarwang/p/11864965.html