I've been using Selenium off and on for the past two years. Recently I've been seeing more references to page objects. (I'm referring to page objects as an means of organizing UI automation code -- not an interface or implementation manifested in the Selenium API.) What are the advantages and disadvantages of using pages objects relative to using a mere collection of functions? Please attempt to justify the advantages and disadvantages.
What are the trade-offs of using page objects instead of a collection of functions in UI automation?
|
Advantages:
is more succinct than
Disadvantage: The only one I could think of is, initial design of page object might take more time but pain is definitely worth it |
|||||||||||||||
|
|
@Tarun In my tests for each main functionality or page of AUT, I will have a class created and it will contain member functions for navigation and user events through each sub features in that class. Other than that, I will have a testNg driven function in the same class that will be calling each of the normal member function of the class that will contain the navigation code . This will separate the navigation code that is kept in the normal java methods and test Control or functionality code that is in the TestNg Method. Here as I am keeping navigation cod e separately, I am able to easily edit them when ever there is minor changes in the UI. Does the Page Object approach you mentioned above make and advantage over this approach. Or am I having a wrong understanding about your approach ? Please elaborate. |
|||||
|
|
Advantages:
Disadvantage:
|
||||
|
|