Page Object

A Page Object is a plain class that represents a page or window on a web or desktop application. This concept comes from the PageObject design pattern for enhancing test maintenance and reducing code duplication.

Representation of a PageObject as a Window

Creating a Page Object

When creating a Page Object you will need the following:

  • Page Object classes must inherit from PageObject class which is under the Mobilize.QualityMate.Automation.Entities namespace.

  • The control property type has to be an interface from the Mobilize.QualityMate.ControlInterfaces namespace(link).

  • The control properties must be declared public and with both get and set accessors.

Simple PageObject

The following is an example of a PageObject declaration

Inner PageObject

Sometimes, a PageObject has a lot of members to maintain, so you can create an Inner PageObject to group members into a smaller representation. Here is a sample of an Inner PageObject.

Representation of Inner PageObjects on a Window

Usage in Code

Once your Page Object is created you will need the UiExecutionController to initialize the PageObject and members with the method GetPageObject(). You can achieve this using the following code:

Check the Best Practices article to know our recommendations on Page Objects.

Last updated

Was this helpful?