在编码的ui测试中传递命令行参数 [英] passing command line arguments in coded ui tests

查看:65
本文介绍了在编码的ui测试中传递命令行参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在已编码的ui测试中传递命令行参数?在普通的C#程序中,我们只是将参数与exe文件一起传递,例如:在命令提示符下传递filename.exe 2 7。

Is it possible to pass command line arguments in coded ui test ? in normal C# programs we just pass the arguments along with the exe file eg: filename.exe "2" "7" in command prompt.

但是可以这样

谢谢

推荐答案

否,您呢?可以做到的。 CodedUi 测试是通过不支持它的 MSTest 通过命令行执行的。在此处中查看可用的命令 MSTest 的在线选项。

No, you can do that. CodedUi tests are executed through command line through MSTest which does not support it. Check here to see the available command-line options of MSTest.

但是,您可以创建另一个 Project (例如控制台应用程序)来实现。第二个项目引用了您的 CodedUI项目。然后,通过此项目的.exe文件传递参数,该文件将调用相应的 CodedUI测试方法。但是我认为这不会像 MSTest 那样工作(它不会创建测试结果)。

However, you can create another Project (e.g. console application) to achieve that. The second project has a reference to your CodedUI Project. Then pass the parameters through the .exe file of this Project which calls the appropriate CodedUI Test Method. But I think that this will not work like MSTest does (it will not create Test Results).

这篇关于在编码的ui测试中传递命令行参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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