简体   繁体   中英

passing command line arguments in coded ui tests

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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