Tutorial by Examples

An example to perform login test based on Page object pattern: import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; /** * Class which models the view of Sign-In page */ publ...

C#

Page Objects should contain behavior, return info for assertions and possibly a method for page ready state method on initialization. Selenium supports Page Objects using annotations. In C# it's as follows: using OpenQA.Selenium; using OpenQA.Selenium.Support.PageObjects; using OpenQA.Selenium.Su...
Create separate files for header and footer(as they are common for all the pages and it does not make sense to make them a part of a single page) Keep common elements(Like Search/Back/Next etc) in separate file(The idea is to remove any kind of duplication and keeping the segregation logical) Fo...

Page 1 of 1