简体   繁体   English

我们是否应该为页面中出现的错误弹出窗口编写单独的页面对象?

[英]Should we write separate page-object for the error pop-ups coming in a page?

Selenium Java Page-Object Model: Should we write separate page-object for the error pop-ups coming in a page? Selenium Java页面对象模型:我们应该为页面中出现的错误弹出窗口编写单独的页面对象吗? I am using the Page Object model and have each page as a single class and the actions in that page as methods. 我正在使用页面对象模型,并将每个页面作为一个单独的类,并将该页面中的操作作为方法。 Now, Should i include the pop-up handling on the same page as a method or should I have to create a separate page-object class for those pop-ups? 现在,我应该将弹出窗口处理与方法包含在同一页面上,还是应该为这些弹出窗口创建单独的页面对象类? What is the best practice.? 最佳做法是什么? Each pop-up has 2 options and some info about the pop-up to verify. 每个弹出窗口都有2个选项以及一些有关验证弹出窗口的信息。

Assuming all pop-ups have particular properties in common, you can create a separate class which would be included into each Page Object. 假设所有弹出窗口都有共同的特定属性,则可以创建一个单独的类,该类将包含在每个Page Object中。 If those description and option fields are always identified with same locators, it seems like a great idea. 如果这些描述和选项字段始终由相同的定位符标识,则似乎是个好主意。

In case those pop-ups differ in a way it is hard to handle them with single class you might consider creating an interface for pop-ups and have each of actual Page Object implement it and handle it on its own. 如果这些弹出窗口在单一类上难以处理的方式不同,则您可以考虑为弹出窗口创建一个接口,并让每个实际的Page Object实现并单独处理它。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我们是否应该为单独的页面对象编写一个带有选择下拉菜单的弹出窗口? - Should we write separate page-object for pop-up with a selection drop-down? 我们可以自动化浏览器设置,例如在浏览器启动时禁用弹出窗口吗? - Can we automate browser settings, like disabling pop-ups whenever browser starts? 在eclipse插件中动态更改弹出窗口 - Changing pop-ups dynamically in eclipse plugin 如何使用Selenium Firefox WebDriver处理多个弹出窗口 - How to handle multiple pop-ups with selenium firefox webdriver 无法使用 Robot 类处理 Windows 10 弹出窗口 - Unable to handle Windows 10 pop-ups using Robot class 处理在Java / Selenium中停止处理的浏览器弹出窗口 - Handling browser pop-ups that stop processing in Java/Selenium 在Java弹出窗口中重复使用JTextField - Re-using JTextField in Java pop-ups 通过Selenium Webdriver(3.x)处理自定义弹出窗口(不是默认窗口) - Handling custom pop-ups (not the default windows one) through selenium webdriver (3.x) In Page Object Model, should an overlay modal window be treated as a separate Page Class or within the “Parent” Page Class? - In Page Object Model, should an overlay modal window be treated as a separate Page Class or within the “Parent” Page Class? 是否可以使用 Java 中的 JOptionPane 同时显示多个弹出窗口? - Is it possible to have multiple pop-ups present at the same time using the JOptionPane in java?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM