在编码的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).