Test Automation With Selenium Using Page Object Design
With Selenium In MJournal
Md. Humayun Kabir
What Is Selenium
Components of Selenium
What is Selenium 2.0
Selenium 2.0 Architecture.
Automating With Selenium 2.0
The Webdriver API
Page Object Design
What is Page Object Design Pattern?
How Does It Work?
Q & A.
What is Selenium?
Selenium is a set of tools for cross-platform automated
testing of web application.
IE, Firefox, Safari, Opera and Other browsers.
Windows, OS x, Linux, Solaris and Others OS’s
C#, Java, Perl, PHP, Python, Ruby and Others
Bromine, NUnit, JUnit, RSpec, TestNG, unittest
A different way of automating the browser.
Create a browser-specific driver to control the
browser directly and have to do this for each browser.
Object oriented API
Doesn’t need a real browser.
No need for a server.
The WebDriver API
Works well with a Page Object design model.
Page Object Design Pattern
A Page Object is a design pattern become popular for
Enhancing test maintenance &
Reducing code duplication
A Page Object is a object oriented class that serves as
an interface to a page of your AUT(Application Under
UI change, tests don’t need to be change, only the code
within the page object need to be changed.
How does it work?
Each page is defined as it’s own class.
Actions (including navigation) are represented as functions for a
Each function returns a new Page object, signifying what page the
actions stops on.
Tests only talk to the page objects.
Page objects only talk to the driver.
Elements on the page are stored as variables for the page object
Tests become a string of well defined functions, not meaningless
Class Inheritance can be used to define functionality to a set of