Page Object Model
Id | Detail |
Define | A page object is an object-oriented class that serves as an interface to a page of your AUT. The tests then use the methods of this page object class whenever they need to interact with the UI of that page.
3. Page class will find the WebElements of that page and also contain Page methods which perform operations on those WebElements |
Advantages | The Page Object Design Pattern provides the following advantages 1. There is a clean separation between test code and page specific code such as locators (or their use if you’re using a UI Map) and layout. 2. There is a single repository for the services or operations offered by the page rather than having these services scattered throughout the tests.
|
Basic Rules | There are a few basic rules for getting the desired maintainability of your test code:
|
User Interface Mapping
Id | Detail |
Define | A User Interface (UI) Map is a mechanism that stores all the locators for a test suite in one place for easy modification when identifiers or paths to UI elements change in the application under test (AUT). |
Advantages | To summarize, a UI Map has two significant advantages
|
Page Factory
Id | Detail |
Define |
@FindBy(how = How.CSS, using = "input[id='submit.button']") WebElement loginLocator;
public Login() { PageFactory.initElements(this.driver, this); } |