Decorate WebElement and WebDriver with your own methods.
Create factory of driver managers, where a driver manager wraps around a specific type of (decorated) driver.
Deyan Perov wrote:I am in dilemma do I need a decorator pattern here. What do you think?
I want to achieve this project (skeleton of the project) can use for mobile testing too (Appium) because of that my goal is to wrap Element and Driver.
How do I look at a decorator? Some methods for Elements may not be applicable in some situations and then I want to override them over decorator.
If you don't like the API provided by WebDriver and WebElement, you can of course provide your own façade that wraps around those classes, but you wouldn't need a custom subclass for every different type of browser. In that case, just rename WebDriverDecorator to SeleniumDriverFacade and make it final. You can then also get rid of Element and all its subtypes, and just return WebElement.
knowledge is the difference between drudgery and strategic action -- tiny ad
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|