为什么要使用页面工厂? [英] Why use Page Factory?

查看:15
本文介绍了为什么要使用页面工厂?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一名新的测试工程师,一直在阅读有关页面对象模型并实现它们的内容,并且不断遇到页面工厂.我知道 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.

这篇关于为什么要使用页面工厂?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆