编码的UI:如何处理处理不同操作的多个浏览器选项卡 [英] Coded UI :How to handle multiple browser tabs working on different operations

查看:102
本文介绍了编码的UI:如何处理处理不同操作的多个浏览器选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,其中,在进行Coded UI Automation测试时,我想在IE 11浏览器的多个实例上运行它,其中2个不同的用户登录到2个浏览器实例。此外,我的应用程序中有不同的用户角色,它们执行不同的操作。 (即,角色1中的用户执行操作1,角色2中的用户执行相同合同上的操作2等。)如何使用Visual Studio的编码UI处理此场景? (浏览器 - IE 11)有没有可用的方法在浏览器实例之间切换?



提前谢谢。

I have an application wherein, while doing the Coded UI Automation testing, I want to run it on multiple instances of IE 11 browser with 2 different users logged in to 2 instances of the browser. Additionally, there are different user roles in my application which do different operations. (i.e. User in Role 1 does Operation 1, User in Role 2 does Operation 2 on the same contract etc. ) How can I handle this scenario using Coded UI with Visual Studio ? (Browser- IE 11) Is there any method available which switches between the browser instances?

Thanks in advance.

推荐答案

我相信你已经过度复杂了。请记住,一个好的测试用例是孤立的,不依赖于另一个测试用例。您的测试计划应该反映测试用例的执行顺序,以便按照所需的顺序处理数据和事件。



对于您的Coded UI测试,我建议不要因为需要运行两个标签而使其复杂化。而是编写Coded UI,以便角色1中的用户执行操作1,然后注销。角色2中的用户登录,执行操作2,然后注销。这将允许您的Coded UI在几个浏览器上运行,几乎不需要进行任何更改。此外,如果Microsoft改变其标签的工作方式,您的Coded UI测试也不需要任何更改。



最后一个想法,不要尝试使用Coded UI测试解决所有测试需求。测试自动化很棒,并且允许我们捕获由于开发人员对系统所做的更改而导致的错误,但它不应该取代手动和探索性测试。



希望这会有所帮助。
I believe you are over complicating this. Remember that a good test case is isolated and does not depend on another test case. Your test plan should reflect the execution order of your test cases so that data and events are processed in the desired sequence.

In the case of your Coded UI test, I would suggest not over complicating it by needing to run two tabs. Instead, write the Coded UI so that User in Role 1 does Operation 1, then logs out. User in Role 2 logs in, does Operation 2, then logs out. This will allow your Coded UI to run on several browsers with very little to no changes needed. In addition, if Microsoft ever changes the way their tabs work, your Coded UI test would not require any changes as well.

One last final thought, don't try to solve all of your testing needs with Coded UI test. Test automation is great and allows us to capture errors due to changes we as developers make to the system, but it should not be a replacement to manual and exploratory testing.

Hope this helps.


这篇关于编码的UI:如何处理处理不同操作的多个浏览器选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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