In UI automation Page Object is a popular design pattern which helps you create UI tests that are easy to maintain and help reducing code duplication. The basic idea behind page objects is that you can create a page class that represents the complete HTML page under test in an object oriented way. For e.g. the controls on the HTML page will be represented by properties in the page class and actions as methods. By doing this it’s very easy to use the benefits of OOPS to create composable menus, headers, footers etc. to reuse those parts
in the page objects. In short Page objects encapsulate the behaviors of the HTML page by exposing methods that reflects the user actions and hides the details of telling the browser how to do these things.
Attributes in C# provides a powerful method of associating declarative information in code (types, methods, properties, and so forth). Once associated with a program entity, the attribute can be queried at run time and used in many ways. We'll see how to use attributes in Page objects to provide information on how to find a control on the DOM and later use...(Read whole news on source site)