为什么要使用Page Factory? [英] Why use Page Factory?

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

问题描述

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

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

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