POM (Page Object Model)
POM (Page Object Model)
• It is an object repository
Why repository?
As per the role of automation we should not hardcode
the element in test scripts, instead we should get
elements from object repository, because in a Agile
process, due to frequent requirement changes
modifications and maintenance of elements is tedious
job.
Advantages of POM?
• We can handle stale element reference exception.
• Reusability of element, no need to write Xpath again
and again.
• Modifications in repository is easy, when GUI
changes frequently.
• Maintenance of elements is easy because all
elements are kept in one place
• More readability
@FindBy(locator=”value”)
Private webElement component name;
Initialization :
Utilization:
We are going to create simple method.