Why use Page Factory?(为什么要使用页面工厂?)
问题描述
我是一名新的测试工程师,一直在阅读有关页面对象模型并实现它们的内容,并且不断遇到页面工厂.我知道 Page Factory 是一个 POM,它提供了额外的功能,例如在调用 Page Factory 时实例化所有元素以及用于测试的更具可读性的代码(尽管我并不完全相信可读性).需要明确的是,我在 POM 上出售.代码的可重用性和相对易于维护性非常好,我正在朝着这个方向发展.
I am a new test engineer and have been reading about Page Object Model and implementing them and keep coming across Page Factory. I understand that Page Factory is a POM that provides additional features such as instantiating all elements when calling Page Factory and more readable code for tests (though I'm not completely sold on the readability). To be clear, I'm sold on POM. The reusability of the code and the relative ease of maintenance are great and I'm building in that direction.
我归结为两个问题:
- 为什么我要实例化所有元素而不是即时进行?
- 我缺少的 Page Factory 的优势是什么?
推荐答案
这是 Selenium 项目负责人兼 Page Factory 的创建者 Simon Stewart 在 2017 年奥斯汀 SeleniumConf 上的演讲.在他的主题演讲中,他说不要使用 Page Factory.演讲的这一部分从这里开始:
Here's Simon Stewart, Selenium project lead and creator of the Page Factory, at the 2017 SeleniumConf in Austin. During his keynote address he says not to use Page Factory. This section of the talk starts here:
https://youtu.be/gyfUpOysIF8?t=1517
实际声明时间为 27:25.
Actual statement is at 27:25.
这篇关于为什么要使用页面工厂?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:为什么要使用页面工厂?


基础教程推荐
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- SSE 浮点算术是否可重现? 2022-01-01
- 将 XML 转换为通用列表 2022-01-01
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- c# Math.Sqrt 实现 2022-01-01
- rabbitmq 的 REST API 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- 如何激活MC67中的红灯 2022-01-01