什么是Selenium WebDriver中的页面对象模式?[英] What is the Page Object Pattern in Selenium WebDriver?

本文是小编为大家收集整理的关于什么是Selenium WebDriver中的页面对象模式?的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

Selenium Webdriver中的页面对象模式是什么?

它的用途是什么?我们如何在Selenium Webdriver中使用它?

将不胜感激.

推荐答案

文档已经涵盖了这一点.如果您有任何特定问题,请随时编辑您的主要帖子.

官方:

非官方: 进行Google搜索,您将获得很多有关此信息的信息.

其他推荐答案

[编辑以回复以下答复.谢谢,我会做的更好.]

页面对象模式的目的是将测试接口完全封装到网页上.这遵循数据隐藏的时间悠久的实践.

这是有关页面对象的Selenium文章.

这是我的帖子"保持页面对象干" .

本文地址:https://www.itbaoku.cn/post/627615.html

问题描述

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.

推荐答案

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

Official:

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

其他推荐答案

[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".