What is the Page Object Pattern in Selenium WebDriver? [closed]

非 Y 不嫁゛ 提交于 2019-11-26 18:57:04

问题


What is page object pattern in Selenium WebDriver?

What is the use of it and how can we use this in Selenium WebDriver?

Example will be appreciated.


回答1:


The documentation has already covered this. If you have any specific questions, feel free to edit your main post.

Official:

  • Page Objects and PageFactory on Selenuim Wiki.
  • Page Object Design Pattern on Selenium official site.

Unofficial: Do a Google search, you will get a lot info on this.

  • Page Object Pattern
  • Page Objects in Selenium 2.0
  • Selenium 2/WebDriver Quick Tips: Page Object Navigation Strategies
  • PageObject by Martin Fowler



回答2:


[Edited to respond to the reply below. And thanks, I'll do better.]

The purpose of the page object pattern is to completely encapsulate the testing interface to the web page. This follows the time-honored practice of data hiding.

Here's the Selenium article about the page object.

And here's my post "Keep Your Page Objects DRY".



来源:https://stackoverflow.com/questions/18094238/what-is-the-page-object-pattern-in-selenium-webdriver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!