Like QTP, TestComplete and few other automation tools selenium webdriver does not provide any centralized repository where we can put object locator of page element. In POM object pattern we can accomplish this type approach.
What is POM:
In automated web testing, a Page Object is a class or object that represents a web page in your application. A Page Object hides the technical details about how you interact with a web page behind a more readable and business-focused facade. Following are the few points in details:
• Page Object Model is a design pattern to create Object Repository for web UI elements. Like it provide you to option to put all locators in corresponding page (java file ) like for home page you create a homepage java file and put all element locators of home page in same class.
• Under this model, you should create java file like above ( homePage.java ) home page and create functions related to this page like clickHomeMenu, clickProduct() verfiyHomePage() etc.
• So your page object class contains elements locator and corresponding function what you need to perform on that particular page.
• Name of these function and object locator must be logically defined like elements name username , password, loginButoon and corresponding function should be like enterUserName(), enterPassword(), clickLoginButton()
What is POM:
In automated web testing, a Page Object is a class or object that represents a web page in your application. A Page Object hides the technical details about how you interact with a web page behind a more readable and business-focused facade. Following are the few points in details:
• Page Object Model is a design pattern to create Object Repository for web UI elements. Like it provide you to option to put all locators in corresponding page (java file ) like for home page you create a homepage java file and put all element locators of home page in same class.
• Under this model, you should create java file like above ( homePage.java ) home page and create functions related to this page like clickHomeMenu, clickProduct() verfiyHomePage() etc.
• So your page object class contains elements locator and corresponding function what you need to perform on that particular page.
• Name of these function and object locator must be logically defined like elements name username , password, loginButoon and corresponding function should be like enterUserName(), enterPassword(), clickLoginButton()