Regarding Page Object Model
ReportQuestion
Hi,
I wanted to know if using Page Object Model can reduce reuse of Code.
For Example,
If we have a clickLogin operation for Login Page in LoginPage.class & clickSaveButton on Home Page inside HomePage.class, both are performing Click on a UI Element.
So will it not be useful to create a generic method click and pass the id as parameter ?
in progress
0
Automation
udit batra
4 years
1 Answer
1215 views
0
Answer ( 1 )
Please briefly explain why you feel this answer should be reported .
Report CancelFrom my experience, in this case I'll create a click method with two options:
1) click method with 2 parameters: element attribute (such as id, name, xpath etc), attribute value
2) click method with one parameter: attribute value. However, with this option, you need to handle your code to detect appropriate attribute
Goodluck