I have a test suite that currently runs across different development environments. Recently a complete rewrite of the application was done & deployed to a new environment.
The application looks & acts almost identically. Page logic is more or less the same. The big difference is the HTML rewrite has rendered my locators useless. I am unsure how to deal with the locators for this new environment while at the same time adhering to the page object model.
The page object model states that all page logic should be kept in the respective page object class. I am assuming that this includes locators as well.
Following this strategy would leave me with a bloated page object class full of duplicate locators. Is there any recommended best practices or clean solutions to combat this problem ?
The possible solutions i can think of are:
- Create separate locator files for each environment and remove them from the page object class.
- Create duplicate or similarly named locators in the current page object class
- Create separate page objects for the new environment
Can anybody comment on whether or not these solutions sound ok ? Or offer any alternative suggestions ?