Difference between revisions of "SINGLE PAGE SCRIPTS"
Line 18: | Line 18: | ||
<span style="font-size: 16px">Here are some blogs with discussion about the Page Object pattern:</span><br /> <br /> <span style="font-size: 16px">http://blog.josephwilk.net/cucumber/page-object-pattern.html,</span><br /> <br /> <span style="font-size: 16px">http://www.shino.de/2011/07/26/on-the-pageobject-pattern/</span><br /> <br /> <br /> | <span style="font-size: 16px">Here are some blogs with discussion about the Page Object pattern:</span><br /> <br /> <span style="font-size: 16px">http://blog.josephwilk.net/cucumber/page-object-pattern.html,</span><br /> <br /> <span style="font-size: 16px">http://www.shino.de/2011/07/26/on-the-pageobject-pattern/</span><br /> <br /> <br /> | ||
− | <span style="font-size: 16px">If you have used this pattern and would like to contribute your experience to the wiki, please go to [[ | + | <span style="font-size: 16px">If you have used this pattern and would like to contribute your experience to the wiki, please go to [[Feedback]] to submit your experience or comment.</span><br /> <br /> |
<span style="font-size: 14px">.................................................................................................................[[Main Page]] / Back to [[Design Patterns]] / Back to [[Test Automation Patterns]]</span></div> | <span style="font-size: 14px">.................................................................................................................[[Main Page]] / Back to [[Design Patterns]] / Back to [[Test Automation Patterns]]</span></div> |
Latest revision as of 15:58, 21 August 2018
Pattern summary
Develop an automation script for each window or page.
In the Selenium Community, this Pattern is known as "PAGE OBJECT".
Category
Design
Context
Use this pattern to build efficient, modular and maintainable testware.
It's not necessary for disposable scripts.
Description
In order to build modular scripts it is convenient to develop one for each window or page that will be driven by the tests.
A "page object" is a test object that holds the details of all the elements on a web page that might be involved in an automated test.
Implementation
If you use KEYWORD-DRIVEN TESTING you can implement this pattern by introducing a keyword for every window in your application. The keyword parameters will drive the GUI-Elements in the window.
For HTML-Pages map a UI page to a class, where for example a page is your HTML page. The functionality to interact or make assertions about that that page is captured within the Page class. Then these methods may be called by a test.
Potential problems
This can become complex if it is not done well. The main benefit is increased maintainability of tests, so it is best used to reduce repetition of the same test code on multiple pages.
Issues addressed by this pattern
Experiences
Here are some blogs with discussion about the Page Object pattern:
http://blog.josephwilk.net/cucumber/page-object-pattern.html,
http://www.shino.de/2011/07/26/on-the-pageobject-pattern/
If you have used this pattern and would like to contribute your experience to the wiki, please go to Feedback to submit your experience or comment.