test automation with selenium using page object design
DESCRIPTION
TRANSCRIPT
![Page 1: Test Automation With Selenium Using Page Object Design](https://reader033.vdocument.in/reader033/viewer/2022061205/548140b0b479592c578b4825/html5/thumbnails/1.jpg)
Automated Web Testing
With Selenium In MJournal
Presented by:
Md. Humayun Kabir
![Page 2: Test Automation With Selenium Using Page Object Design](https://reader033.vdocument.in/reader033/viewer/2022061205/548140b0b479592c578b4825/html5/thumbnails/2.jpg)
Discussion on:What Is Selenium
Components of Selenium
What is Selenium 2.0
Selenium 2.0 Architecture.
WebdriverWebdriver Introduction
Automating With Selenium 2.0
The Webdriver API
Page Object DesignWhat is Page Object Design Pattern?
How Does It Work?
MJournal Automation.
Q & A.
![Page 3: Test Automation With Selenium Using Page Object Design](https://reader033.vdocument.in/reader033/viewer/2022061205/548140b0b479592c578b4825/html5/thumbnails/3.jpg)
What is Selenium?
Selenium is a set of tools for cross-platform automated
testing of web application.
Selenium Supports:
IE, Firefox, Safari, Opera and Other browsers.
Windows, OS x, Linux, Solaris and Others OS’s
C#, Java, Perl, PHP, Python, Ruby and Others Languages
Bromine, NUnit, JUnit, RSpec, TestNG, unittest
![Page 4: Test Automation With Selenium Using Page Object Design](https://reader033.vdocument.in/reader033/viewer/2022061205/548140b0b479592c578b4825/html5/thumbnails/4.jpg)
Components of Selenium?
![Page 5: Test Automation With Selenium Using Page Object Design](https://reader033.vdocument.in/reader033/viewer/2022061205/548140b0b479592c578b4825/html5/thumbnails/5.jpg)
What is Selenium 2.0
![Page 6: Test Automation With Selenium Using Page Object Design](https://reader033.vdocument.in/reader033/viewer/2022061205/548140b0b479592c578b4825/html5/thumbnails/6.jpg)
Webdriver Introduction
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 Javascript limitations
No need for a server.
![Page 7: Test Automation With Selenium Using Page Object Design](https://reader033.vdocument.in/reader033/viewer/2022061205/548140b0b479592c578b4825/html5/thumbnails/7.jpg)
The WebDriver API
Works well with a Page Object design model.
![Page 8: Test Automation With Selenium Using Page Object Design](https://reader033.vdocument.in/reader033/viewer/2022061205/548140b0b479592c578b4825/html5/thumbnails/8.jpg)
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 Test). If
UI change, tests don’t need to be change, only the code within the page object need to be changed.
![Page 9: Test Automation With Selenium Using Page Object Design](https://reader033.vdocument.in/reader033/viewer/2022061205/548140b0b479592c578b4825/html5/thumbnails/9.jpg)
How does it work?
Each page is defined as it’s own class.
Actions (including navigation) are represented as functions for a class.
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 gibberish.
Class Inheritance can be used to define functionality to a set of pages.
![Page 10: Test Automation With Selenium Using Page Object Design](https://reader033.vdocument.in/reader033/viewer/2022061205/548140b0b479592c578b4825/html5/thumbnails/10.jpg)
MJournal Automation
Page Object Pattern:
![Page 11: Test Automation With Selenium Using Page Object Design](https://reader033.vdocument.in/reader033/viewer/2022061205/548140b0b479592c578b4825/html5/thumbnails/11.jpg)
Page Object Pattern: Open Frontpage
![Page 12: Test Automation With Selenium Using Page Object Design](https://reader033.vdocument.in/reader033/viewer/2022061205/548140b0b479592c578b4825/html5/thumbnails/12.jpg)
Page Object Pattern: How Search working?
![Page 13: Test Automation With Selenium Using Page Object Design](https://reader033.vdocument.in/reader033/viewer/2022061205/548140b0b479592c578b4825/html5/thumbnails/13.jpg)
How is it easy to handle [base class]
![Page 14: Test Automation With Selenium Using Page Object Design](https://reader033.vdocument.in/reader033/viewer/2022061205/548140b0b479592c578b4825/html5/thumbnails/14.jpg)
Page object Class
![Page 15: Test Automation With Selenium Using Page Object Design](https://reader033.vdocument.in/reader033/viewer/2022061205/548140b0b479592c578b4825/html5/thumbnails/15.jpg)
Page Object Design: Create User, check it, delete it, & Check it again (in base class)
![Page 16: Test Automation With Selenium Using Page Object Design](https://reader033.vdocument.in/reader033/viewer/2022061205/548140b0b479592c578b4825/html5/thumbnails/16.jpg)
Page Object Design: Create User, check it, delete it, & Check it again (in Page object class)
![Page 17: Test Automation With Selenium Using Page Object Design](https://reader033.vdocument.in/reader033/viewer/2022061205/548140b0b479592c578b4825/html5/thumbnails/17.jpg)
Add test cases to NUnit
![Page 18: Test Automation With Selenium Using Page Object Design](https://reader033.vdocument.in/reader033/viewer/2022061205/548140b0b479592c578b4825/html5/thumbnails/18.jpg)
Expecting this screen
![Page 19: Test Automation With Selenium Using Page Object Design](https://reader033.vdocument.in/reader033/viewer/2022061205/548140b0b479592c578b4825/html5/thumbnails/19.jpg)
Mjournal Test automation
Lets go to real automation: going to code
![Page 20: Test Automation With Selenium Using Page Object Design](https://reader033.vdocument.in/reader033/viewer/2022061205/548140b0b479592c578b4825/html5/thumbnails/20.jpg)
Q & A
![Page 21: Test Automation With Selenium Using Page Object Design](https://reader033.vdocument.in/reader033/viewer/2022061205/548140b0b479592c578b4825/html5/thumbnails/21.jpg)
Thank you!!!