How may I implement Java interfaces with Selenium WebDriver Page Object pattern?
by (171 points)
Can you give  me a scenario which I can take as a base to give you the explanation?
by (391 points)
How may I implement an interface for a page object?

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

1 Answer

by (171 points)
0 votes
Implementation of interface for PageObject does not make any sense to me. As PageObjects are collection of elements from the webpage. You can use abstract class to have common methods, like login, click, wait store in that class and extend that class with all your page objects.

You implement interface when you are writing your own framework, and you want user to write their own line of code and so you can utilize it further.

Hope that helps.