MsTest.exe找不到任何测试。

4

我有一个使用Selenium Specflow C#的项目,可以通过测试资源管理器和ReSharper单元测试资源管理器执行测试。

但是当我运行命令行来执行测试(这是Jenkins执行测试的方式)

它无法在DLL中找到任何测试。

mstest /testcontainer:MoneyUITests.dll /test:NavigateToLoans
Microsoft (R) Test Execution Command Line Tool Version 15.0.26621.2
Copyright (c) Microsoft Corporation. All rights reserved.

Loading MoneyUITests.dll...
Test NavigateToLoans cannot be found.
Test NavigateToLoans cannot be found.
Starting execution...
No tests to execute.

我不确定我做错了什么,奇怪的是Visual Studio能够找到并执行测试而没有问题。


1
一个解决方案:放弃使用MS/VSTest,改用nUnit :) - thanatorr
1个回答

6

这是因为在Visual Studio 2010中使用了mstest.exe进行测试。从Visual Studio 2012开始,您应该使用VSTest.Console.exe。

您是否尝试过使用VSTest.Console.exe而不是mstest.exe?

我已经在stackoverflow上找到了答案:如何在命令提示符中运行selenium c#测试的答案?


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接