VSTS编码UI与Selenium [英] VSTS coded UI vs. Selenium

查看:135
本文介绍了VSTS编码UI与Selenium的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

过去6年来,我一直在使用测试自动化,最近几年我使用过Selenium / Ruby。因此,我认为自从我的新雇主使用Visual Studio以来,我会给VSTS 2010编码的UI测试。首先,微软声称一个巨大的优势是生成.NET语言。好吧,在我看来,测试人员使用Python或Ruby会更有效率,因为像Java这样的C#是静态类型且非常冗长。无论如何,我创建了两个简单的测试。第一次去谷歌,做了一个简单的搜索。第二次测试是谷歌翻译,并进行了简单的翻译。我使用内置录音机完成了所有这些。

结果:
1。仅在UIMap.Designer.cs文件中生成10个类和430行代码。所有基本代码最终都在同一个文件中,即上面的第3个文件。记录器似乎生成了许多我没有要求的代码,例如页面信息。

对于不是一个完全没有问题的程序员的测试人员来说,这可能是一个非常可怕的事情。毕竟你需要能够维持测试,这需要一些时间才能完成记录下来的混乱。
在Selenium中,基本代码看起来像这样。如果使用IDE作为记录器,则代码行数为28.
Test1
@ selenium.open" http:// www.google.com/ "
@ selenium.type" q"," Microsoft"
@ selenium.click" btnG"

测试2
@ selenium.open" http://www.google.com/ "
@selenium。输入"来源","你好"和"selenium.click""old_submit""发票摘要:
我很难看到我会用VSTS中的内置录像机,如果我将使用编码的UI测试,我可能必须学会自己编写测试。然后,Selenium和Ruby很容易: - )

I have been working with test automation on and off for the last 6 years, the latest years I've used Selenium/Ruby. So, I thought I'd give VSTS 2010 coded UI tests a look since my new employer is using Visual Studio. First of all, Microsoft is claiming a big advantage is the generation of .NET languages. Well, a tester would be more productive using Python or Ruby in my opinion since C# like Java is static typed and very verbose. Anyway, I created two simple tests. The first went to Google, did a simple search. The second test went to Google Translate and did a simple translation. I did all this using the built-in recorder.

Result:
1. 10 classes and 430 lines of code is produced in the UIMap.Designer.cs file alone
2. All essential code ends up in the same file, the one above
3. The recorder seems to generate a lot of code that I haven't asked for, like page information.

For a tester that isn't a full-fletched programmer, this is probably a really scary thing. It would take some time to sort that recorded mess up, after all you would like to be able to maintain your tests.

In Selenium, the essential code would look like this. If using the IDE as recorder, number of code lines was 28.
Test1
    @selenium.open "http://www.google.com/"
    @selenium.type "q", "Microsoft"
    @selenium.click "btnG"
   
Test2  
    @selenium.open "http://www.google.com/"
    @selenium.type "source", "Hello"
    @selenium.click "old_submit"


Summary:
I have a hard time seeing that I will use the built-in recorder in VSTS, if I will ever use the coded UI test I will probably have to learn to write the tests on my own. Then again, Selenium and Ruby is so easy :-)

推荐答案

我听到你的意见。然而,VS ALM(因为它被称为2010)不仅记录了网络应用程序,还记录了wpf,winform,silverlight。我不知道细节,但我可以想象您需要更多代码用于这些平台。

但是当您添加测试用例工作项时,您可以定义测试应执行的步骤。测试中的每一步都将转换为一种方法。您应该使用这些方法来遵循编码的ui测试的流程。通常情况下,只需使用编码的ui测试。对于不是开发人员和开发人员的测试人员来说,这是一个很好的工具,他们不是将这些UI测试作为单元测试的测试人员。

如果你想编写自己的ui测试并且Selenium适用于你继续使用那个工具。
I hear your comments. However, VS ALM (as it is called for 2010) not only records web apps, but also wpf, winform, silverlight. I don't know the details, but I can imagine that you need more code for those platforms.

However when you add a test case work item, then you can define the steps the test should perform. Every  step in the test will be converted to one method. You should use those methods to follow the flow of the coded ui test. Normally when you just use the coded ui test as it is. It is a great tool for testers that are not a developer and developers that are not a tester to get those UI tests as a unit test.

If you want to write your own ui tests and Selenium works for you, then keep using that tool.


这篇关于VSTS编码UI与Selenium的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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