passing command line arguments in coded ui tests

不想你离开。 提交于 2019-12-10 15:34:40

问题


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.

but can something like this be done in coded ui tests?

Thanks


回答1:


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.

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).



来源:https://stackoverflow.com/questions/10299599/passing-command-line-arguments-in-coded-ui-tests

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!