I have been hearing a lot about page object modelling? Why is it so important?
Can someone please outline me page object model?
I'm currently working as QE in webservices area
Or from this page
and a tutorial here
Your question hints at a couple of questions:
What Is a Page Object?
A page object is code written to model an actual page (or part of a page) in a web application. Eg. each page in your app, would have an associated page object file that provides the “services” that the actual page offers. Eg. if there’s a button on a page in your application, you would have a reference to that button in your page object. If you then write a test that clicks that button, you would access the button through the page object.
Why Use Page Objects?
Page object provide many benefits, including:
How To Use Page Objects
A Page Object approach can be thought of as giving and using names for commonly used pieces of HTML pages.
For example if you identify a button in three places this way:
There are now three problems:
A Page Object approach solved this by giving the HTML DOM identifying elements/attributes a name, for example
Then this is used in the code, e.g.
and when it needs to updated for example to be a div instead of a button you can just update
Store these defintions in one place and include them in the test spec and then the spec doesn't need to change when the page does.