简体   繁体   English

在编码的ui测试中传递命令行参数

[英]passing command line arguments in coded ui tests

Is it possible to pass command line arguments in coded ui test ? 是否可以在编码的ui测试中传递命令行参数? in normal C# programs we just pass the arguments along with the exe file eg: filename.exe "2" "7" in command prompt. 在正常的C#程序中,我们只是将参数和exe文件一起传递,例如:filename.exe“2”“7”在命令提示符下。

but can something like this be done in coded ui tests? 但这样的事情可以在编码的ui测试中完成吗?

Thanks 谢谢

No, you can do that. 不,你可以做到。 CodedUi tests are executed through command line through MSTest which does not support it. CodedUi测试通过命令行通过MSTest执行,而MSTest不支持它。 Check here to see the available command-line options of MSTest . 点击此处查看MSTest的可用命令行选项。

However, you can create another Project (eg console application) to achieve that. 但是,您可以创建另一个Project (例如控制台应用程序)来实现这一目标。 The second project has a reference to your CodedUI Project . 第二个项目引用了CodedUI Project Then pass the parameters through the .exe file of this Project which calls the appropriate CodedUI Test Method . 然后通过此Project的.exe文件传递参数,该文件调用相应的CodedUI Test Method But I think that this will not work like MSTest does (it will not create Test Results). 但我认为这不会像MSTest那样MSTest (它不会创建测试结果)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM