What's the best way to automate testing the UI in an Asp.net Page?
在Asp.net页面中自动测试UI的最佳方法是什么?
9 个解决方案
#2
3
Quite loosely defined question so a good answer is almost impossible. Would dare to suggest that using Selenium might help with automating the task.
相当松散定义的问题,所以一个好的答案几乎是不可能的。敢于建议使用Selenium可能有助于自动执行任务。
#3
2
If you are the only coder on a project, I would suggest testing it by hand. That said, you will likely suffer from coder myopathy. Since you wrote the code and know what it is supposed to do, you may subconsciously avoid actions that will break it.
如果您是项目中唯一的编码员,我建议您手动测试。也就是说,你可能患有编码器肌病。既然你编写了代码并知道它应该做什么,你可能会下意识地避免会破坏它的行为。
I have worked with different automation methods and they tend to be fairly heavy. In other words, you will find yourself working on updating your tests more often than you would like. In my opinion, automated testing only becomes necessary when you have more than one developer on a project and they are not aware of the full scope.
我使用过不同的自动化方法,但它们往往相当沉重。换句话说,您会发现自己更频繁地更新测试,而不是您想要的。在我看来,只有当项目中有多个开发人员并且他们不了解完整范围时,才需要进行自动化测试。
In the ideal environment, a developer would have a dedicated tester who would write and maintain tests, as well as validate that the code was functionally correct and met the business requirements.
在理想的环境中,开发人员可以拥有专门的测试人员,他们可以编写和维护测试,并验证代码在功能上是否正确并满足业务需求。
In the real world, lots of developers are basically lone wolves with limited resources and time and the best way to have solid, bug-free code is to understand the business requirements and then make sure that when writing the code, you make no mistakes. :-)
在现实世界中,许多开发人员基本上都是孤狼,资源和时间有限,拥有可靠,无错误代码的最佳方法是了解业务需求,然后确保在编写代码时不会出错。 :-)
#4
0
Not sure about the "best" way, that's probably quite a loaded question...
不确定“最好”的方式,这可能是一个非常有问题...
One way is to use the Web Tests in the Test edition of Visual Studio, see MSDN documentation. Also here's a simple tutorial.
一种方法是使用Visual Studio测试版中的Web测试,请参阅MSDN文档。这里还有一个简单的教程。
#5
0
What specifically are you testing for? Cross browser compliance? Performance? Usability? That's a pretty broad question - can you define it a little more?
您具体测试的是什么?跨浏览器合规性?性能?可用性?这是一个非常广泛的问题 - 你能再定义一下吗?
#6
0
In terms of User Acceptance? Bug hunting? Load testing?
在用户接受方面?虫子狩猎?负载测试?
For the first one, get other people to use it and comment on it.
对于第一个,让其他人使用它并对其进行评论。
For the second one you should use your test plans and test cases that you wrote beforehand to test the UI, in terms of data validation (server-side as well as javascript), range checking and all that stuff. I believe there are tools that simulate clicks as well that you could use.
对于第二个,您应该使用您预先编写的测试计划和测试用例来测试UI,包括数据验证(服务器端和javascript),范围检查以及所有这些内容。我相信有些工具可以模拟您可以使用的点击次数。
For the third, try JMeter.
对于第三个,尝试JMeter。
As for testing the engine behind the website, you can bypass the web interface and write test classes that call the engine directly (if it isn't coded directly into the ASP) to test its functions. I would call this a different task to testing the UI however.
至于测试网站后面的引擎,您可以绕过Web界面并编写直接调用引擎的测试类(如果它没有直接编码到ASP中)来测试其功能。我会称这是一个不同的任务来测试UI。
#7
0
AspUnit which can be found on SourceForge.net. However the project is no longer actively developed but it will work on .Net 1.1 and 2.0.
可以在SourceForge.net上找到的AspUnit。然而,该项目不再积极开发,但它将在.Net 1.1和2.0上运行。
#8
0
- Setup a room with several terminals running your application
- Prepare a list of tasks to be completed
- Bring in volunteers to run through the tasks
- Monitor the actions of the volunteers either through taping or a one way mirror
设置一个房间,其中有多个终端运行您的应用
准备要完成的任务列表
带来志愿者完成任务
通过录音或单向镜监视志愿者的行为
Rinse and Repeat!
冲洗并重复!
#9
0
I vote for Test Manager in Visual Studio 2010 and then generate "Coded UI tests" for it!
我投票支持Visual Studio 2010中的测试管理器,然后为它生成“编码的UI测试”!
- Very easy to create assertions
- Very nice code (Readable!)
- Easy and maintainable, because the code is easy to read and you can change the way how controls are found on the page
很容易创建断言
非常好的代码(可读!)
易于维护,因为代码易于阅读,您可以更改页面上控件的显示方式
I did a quick comparison or WatiN, Selenium and Test Manager VS2010
我做了一个快速比较或WatiN,Selenium和测试经理VS2010
#1
#2
3
Quite loosely defined question so a good answer is almost impossible. Would dare to suggest that using Selenium might help with automating the task.
相当松散定义的问题,所以一个好的答案几乎是不可能的。敢于建议使用Selenium可能有助于自动执行任务。
#3
2
If you are the only coder on a project, I would suggest testing it by hand. That said, you will likely suffer from coder myopathy. Since you wrote the code and know what it is supposed to do, you may subconsciously avoid actions that will break it.
如果您是项目中唯一的编码员,我建议您手动测试。也就是说,你可能患有编码器肌病。既然你编写了代码并知道它应该做什么,你可能会下意识地避免会破坏它的行为。
I have worked with different automation methods and they tend to be fairly heavy. In other words, you will find yourself working on updating your tests more often than you would like. In my opinion, automated testing only becomes necessary when you have more than one developer on a project and they are not aware of the full scope.
我使用过不同的自动化方法,但它们往往相当沉重。换句话说,您会发现自己更频繁地更新测试,而不是您想要的。在我看来,只有当项目中有多个开发人员并且他们不了解完整范围时,才需要进行自动化测试。
In the ideal environment, a developer would have a dedicated tester who would write and maintain tests, as well as validate that the code was functionally correct and met the business requirements.
在理想的环境中,开发人员可以拥有专门的测试人员,他们可以编写和维护测试,并验证代码在功能上是否正确并满足业务需求。
In the real world, lots of developers are basically lone wolves with limited resources and time and the best way to have solid, bug-free code is to understand the business requirements and then make sure that when writing the code, you make no mistakes. :-)
在现实世界中,许多开发人员基本上都是孤狼,资源和时间有限,拥有可靠,无错误代码的最佳方法是了解业务需求,然后确保在编写代码时不会出错。 :-)
#4
0
Not sure about the "best" way, that's probably quite a loaded question...
不确定“最好”的方式,这可能是一个非常有问题...
One way is to use the Web Tests in the Test edition of Visual Studio, see MSDN documentation. Also here's a simple tutorial.
一种方法是使用Visual Studio测试版中的Web测试,请参阅MSDN文档。这里还有一个简单的教程。
#5
0
What specifically are you testing for? Cross browser compliance? Performance? Usability? That's a pretty broad question - can you define it a little more?
您具体测试的是什么?跨浏览器合规性?性能?可用性?这是一个非常广泛的问题 - 你能再定义一下吗?
#6
0
In terms of User Acceptance? Bug hunting? Load testing?
在用户接受方面?虫子狩猎?负载测试?
For the first one, get other people to use it and comment on it.
对于第一个,让其他人使用它并对其进行评论。
For the second one you should use your test plans and test cases that you wrote beforehand to test the UI, in terms of data validation (server-side as well as javascript), range checking and all that stuff. I believe there are tools that simulate clicks as well that you could use.
对于第二个,您应该使用您预先编写的测试计划和测试用例来测试UI,包括数据验证(服务器端和javascript),范围检查以及所有这些内容。我相信有些工具可以模拟您可以使用的点击次数。
For the third, try JMeter.
对于第三个,尝试JMeter。
As for testing the engine behind the website, you can bypass the web interface and write test classes that call the engine directly (if it isn't coded directly into the ASP) to test its functions. I would call this a different task to testing the UI however.
至于测试网站后面的引擎,您可以绕过Web界面并编写直接调用引擎的测试类(如果它没有直接编码到ASP中)来测试其功能。我会称这是一个不同的任务来测试UI。
#7
0
AspUnit which can be found on SourceForge.net. However the project is no longer actively developed but it will work on .Net 1.1 and 2.0.
可以在SourceForge.net上找到的AspUnit。然而,该项目不再积极开发,但它将在.Net 1.1和2.0上运行。
#8
0
- Setup a room with several terminals running your application
- Prepare a list of tasks to be completed
- Bring in volunteers to run through the tasks
- Monitor the actions of the volunteers either through taping or a one way mirror
设置一个房间,其中有多个终端运行您的应用
准备要完成的任务列表
带来志愿者完成任务
通过录音或单向镜监视志愿者的行为
Rinse and Repeat!
冲洗并重复!
#9
0
I vote for Test Manager in Visual Studio 2010 and then generate "Coded UI tests" for it!
我投票支持Visual Studio 2010中的测试管理器,然后为它生成“编码的UI测试”!
- Very easy to create assertions
- Very nice code (Readable!)
- Easy and maintainable, because the code is easy to read and you can change the way how controls are found on the page
很容易创建断言
非常好的代码(可读!)
易于维护,因为代码易于阅读,您可以更改页面上控件的显示方式
I did a quick comparison or WatiN, Selenium and Test Manager VS2010
我做了一个快速比较或WatiN,Selenium和测试经理VS2010