New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test Explorer does not see any test #81
Comments
Same problem in my project. Worked before, but perhaps a recent VS upgrade broke this? |
The Express editions don't support extensions. Are you sure you didn't use another edition earlier ? |
I have the same problem in Enterprise 2015 |
@johnlundberg: Do you use the NUnit vsix adapter or the NUnit nuget adapter ? And, NUnit 2 or NUnit 3 ? |
I installed from the "Extensions and Updates" menu so I suppose it is the vsix adapter. It is NUnit 2. |
If you do a test run, what is written to the Output/Test pane ? |
I click "Run All" in the Test Explorer and the solution builds, but nothing at all gets written to the Tests pane. I used Code Rush's test runner before updating to Visual Studio 2015, so I am a bit unfamiliar with the Test Explorer. I might be doing something wrong but I don't think so. |
I you just do a Rebuild All, then look in the Output/Test pane, you should see the following: |
Ah, Rebuild did the trick, I thought the discovering would be triggered by a build. Also my Default Processing Architecture was set to x86 while my tests where x64. Therefore they were never found the last time I did the rebuild. Sorry to take up your time, and thank you for your help |
Dear colleagues, sorry for not taking part in discussion, was away for vacation. I've installed VS community edition, changed the Build Platfrom Target option to Any CPU (my system is 64) and the issue gone. After my project was build I got tests in Test Explorer. Many thanks once again for helping in fixing the issue. |
I was having this same issue with Nunit 3.* and test runner 3.*. The only thing that identified the issue was using the Developer Command Prompt and running the "dotnet test" command. The issue which the command prompt surfaced was that the test-runner couldn't "Could not load file or assembly 'Microsoft.DotNet.InternalAbstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies. The system cannot find the file specified." After loading this hidden dependency, my tests were discovered. |
@jllblk The NUnit VS adapter does not support .NET Core tests. |
Have the same issue, it does not depend on VS adapter. "dotnet test" command from console just fail. |
Go to project.json, under "dependencies" section and manually add a reference to "Microsoft.DotNet.InternalAbstractions:1.0.0.0", this fixed my issue. |
Hi, I am also seeing no Tests in Run Tests while using NTest with Visual Studio 2015 Enterprise Solution. I have tried all the above mentioned steps except the last one mentioned by jllblk. Could not locate the option in Microsoft.Any help on the same will be highly appreciated. |
You need to use |
I had similar issue in which my test was not getting listed after build. In my case, the project that I had created was configured for x64, and by default the "Default Processor Architecture" for the Testing framework was x86. Changing the default processor architecture under Test-->Test Settings to x64 resolved the issue in my case. |
FWIW: I have a blog post here http://hermit.no/how-to-control-the-selection-of-test-runner-in-tfsvsts-making-it-work-with-x86x64-selected-targets/ discussing the x64/x86 test issue and methods on how to solve it with VS and TFS. |
I had the similar kind of issue, where I was pulling the Test Data from a spreadsheet based on the Test Name, so make sure your test names are unique in the spread sheet, otherwise you won't find the test cases in Test Explorer after you build the solution. |
I have .net core v2.0 project and I did the clean solution first and then the build where I saw the Microsoft.NET.Test.Sdk compatibility issue in the logs. I didn't need this and removed it, which made the tests visible in the explorer and they could be run. |
If your test project is set to target a 64bit platform, the tests won't show up in the NUnit Test Adapter. |
@dkprajapati1988 That is not correct. |
Hi Have the same issue - Test would not show up. 0 Background: Our scripts were developed with VS 2013 and used NUnit VS Adapter 2.1.. Upon Build we would see this message: [Informational] NUnit Adapter 3.10.0.21: Test discovery starting [Informational] Assembly contains no NUnit 3.0 tests: C:\ihealautomatedTests\SeleniumTest\bin\x86\Debug\SeleniumTest.dll [Informational] NUnit Adapter 3.10.0.21: Test discovery complete Solution (temporary): - Uninstall NUnit Adapter 3.10... - Install NUnit VS Adapter 2.1.. Now the Tests are shown. Still need to figure out how to make our scripts work with newer Adapter version... Any idea??? - please let me know. If it is a different topic - please let me know and will remove my comments. Thank you |
@andrewkhomski It doesn't sound like the same issue at all, I'm afraid. :-) You were using the 2.1 adapter, which worked. That indicates you were using NUnit version 2 as the framework, since that's what the "NUnit VS Adapter" supports. You switched to version 3.10 of the "NUnit 3 VS Adapter", which is not exactly an upgrade but an entirely different product. It only works with the NUnit 3 framework. You don't say you upgraded to the NUnit 3 framework, so I'm assuming you didn't. So the solution for you appears to be to first upgrade your tests to NUnit 3. For some people that's trivial, for others it's not, since NUnit 3 has breaking changes from NUnit V2. See the Breaking Changes page in the NUnit docs. If you anticipate problems with an upgrade to NUnit 3, please take a look at my release of NUnit 2.6.6, which gives some help in upgrading. It's available at https://github.com/nunit-legacy/nunitv2. |
Thank you very much Charlie! Actually - you are correct - i was too happy that the Tests got shown in the Test Explorer.. I will research on your article and will provide update. Thank you, |
In my case NUnit Test Adapter was not install in VS 2015. I installed NUnit Test Adapter 2.0 since I was running NUnit version 2.6.4. Build the project and test were discovered. Thanks for all the different ideas thrown up here. |
I use Visual Studio Express 2015 and want to have Nunit tests.
I've added Nunit framework, Nunit adapter (Nunit Runner also tried to add) to the solution/project reference then cleaned and built solution but test did not appear in Test Explorer.
I tried to use Nunit framework with Console Application, with Class Library and with both there were no tests in Test Explorer after solution was built.
As a reference I used the following tutorial:
https://www.visualstudio.com/en-us/get-started/code/create-and-run-unit-tests-vs
My code is :
''''
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Selenium_Second_Project
{
[TestFixture]
public class Class1
{
IWebDriver driver = new ChromeDriver();
static void Main(string[] args)
{
}
[SetUp]
public void Initialise()
{
driver.Manage().Window.Maximize();
driver.Navigate().GoToUrl("http://www.google.com");
}
[Test]
public void ExecuteTest_1()
{
IWebElement element = driver.FindElement(By.Name("q"));
element.SendKeys("test automation");
System.Threading.Thread.Sleep(5000);
}
[TearDown]
public void CloseDriver()
{
driver.Close();
}
}
}
''''
The text was updated successfully, but these errors were encountered: