Difference between revisions of "SINGLE PAGE SCRIPTS"
Line 15: | Line 15: | ||
''<span style="font-size: 16px">[[GIANT SCRIPTS]]</span>''<br /> ''<span style="font-size: 16px">[[OBSCURE TESTS]]</span>'' | ''<span style="font-size: 16px">[[GIANT SCRIPTS]]</span>''<br /> ''<span style="font-size: 16px">[[OBSCURE TESTS]]</span>'' | ||
=<span style="font-size: 16px">'''Experiences'''</span>= | =<span style="font-size: 16px">'''Experiences'''</span>= | ||
− | |||
− | |||
<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 /> |
Revision as of 08:42, 5 July 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 Experiences to submit your experience or comment.