October 2014
Intermediate to advanced
544 pages
13h 12m
English
In Chapter 16, “Test Automation Design Patterns and Approaches,” Tony Sweets explained the concepts behind using the Page Object pattern for designing automated tests. Here are code snippets and technical details so that you can try this out yourself.
The following piece of code is a Page Object for the Wikipedia home page. It is written in Java using Selenium 2 (WebDriver). This particular Page Object has two public methods (or actions) it can perform. We can either click the privacy link, or we can search Wikipedia using the term “Nissan Motor Company.” These two methods (plus the initializer method, which is known as the constructor) make up this Page Object’s ...
Read now
Unlock full access