Implementing nested Page Object instances
So far, we explored a very simple Page Object implementation for a single page web application. We can use the Page Object model to implement the objects of a page in a complex web application to simplify the testing.
In this recipe, we will create the objects of the Page Object model for the search functionality in an e-commerce application found at http://demo.magentocommerce.com/. We can implement a Page Object model even if the specific functionality is not a page of its own. In the sample application, the search feature is available throughout the application. However, let's find out how it's been used from the application's home page.
Each page of the application provides the user with the ability to search products from the site by entering a query and hitting the search button. When a search query is submitted, the application returns a new page with a list of products matching the search query. Using the approach described in this recipe,...