Page Object
Last updated
Last updated
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.
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.
The following is an example of a PageObject declaration
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.
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.