I am using selenium rc and php with phpunit (choice of language is project requirement).
I am writing a custom test framework for a e-commerce webstore.
I have following classes:
1. BuyProducts (Product buying process.)
2. UIObjects (This class holds all the locators.)
3. Actions (This has actions to perform process.)
4. Navigation (This class will have all the locators and methods to navigate throughout website.)
Above class names should be self explanatory.
BuyProducts class calls methods of Actions class and Action class calls methods of both UIObject & Navigation classes.
I am getting a peculiar error message when I create 2 object instances (for UIObjects & Navigation) in Actions class.
With Actions class I'm just creating another layer of abstraction. The UIObject class holds nothing but the locators for the page (Ideally its a UI Map class).
Ideally, a page object class should include all the locators and functionalities that page provides. What I did is I separated locators from functionalities in different classes. This practically means breaking page object class into two different class.
This seems to be useful if the page is very big. Eg. the checkout page I am working on, in the web store is higly ajax based, and different steps of the checkout (login/register, billing, shipping address, delivery method, payment, order verification, and order success) are all in the same page.
This was the reason behind breaking them up. This definitely adds some code complexity. But I didnt find any other way around it.