运行CodedUI测试以自动执行操作 [英] Run CodedUI test to automate actions

查看:108
本文介绍了运行CodedUI测试以自动执行操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在测试项目之外运行CodedUI步骤?

Is there a way of running CodedUI steps outside a test project?

我想使用它们来自动执行应用程序中的某些操作。

I want to use them to automate some actions in an application.

推荐答案

程序 mstest.exe 可用于调用编码的UI测试。它的 / test:{测试名称} 选项允许执行特定的测试(即活动),因此可以将几个不同的活动(即测试)组合到一个源文件中,但是仅执行所需的活动。从批处理或Powershell脚本中调用 mstest.exe 即可执行活动,而无需每次都键入长命令。

The program mstest.exe can be used to invoke Coded UI tests. Its /test:{test name}option allows a specific test (ie activity) to be executed, thus several different activities (ie tests) to be combined into one source file but only the desired activity is executed. Calling mstest.exe from a batch or Powershell script allows the activity to be executed without needing to type a long command each time.

如果您已经使用了编码UI,则没有理由不能将其用于自动化一系列GUI操作。

If you already use Coded UI then there is no reason why it cannot be used for automating a series of GUI actions.

一个例子:对于一个项目,我们需要在每个系列的测试之前从备份中设置数据库。手动花了5分钟,有时我们做错了,所以浪费了时间。有了编码用户界面,它始终可以正常运行,并且运行迅速。

An example: For one project we needed to set a database from a backup before each series of tests. Manually that took 5 minutes and sometimes we did it wrong and so wasted time. With Coded UI it always worked and it ran quickly.

这篇关于运行CodedUI测试以自动执行操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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