0
votes

I've been running Selenium tests in Visual Studio using C# and everything works fine locally. I have an automated build process in TFS that runs unit tests in my solution. That task (Test Assemblies) is finding the new Selenium tests but failing to run them. However, when I created a separate build definition that deployed a test agent (successfully) and then attempts to run functional tests, I get this message:

    2017-11-03T18:49:43.1345753Z ##[warning]DistributedTests: Test Run Discovery Aborted . Test run id : 1600
    2017-11-03T18:49:43.1345753Z ##[warning]DistributedTests: UnExpected error occured during test execution. Try again.
    2017-11-03T18:49:43.1345753Z ##[warning]DistributedTests: Error : No tests were discovered from the specified test sources

I have searched the DTALog, and found that the test sources are being found successfully, just no actual tests within them. Any ideas what I am doing wrong? I have removed the 'Owner' decoration from the tests.

1
What test framework is being used? Is the appropriate test adapter getting deployed along with the test assemblies?Daniel Mann
@Shaagnik Mukherji Can you try running the vstest.console.exe in the test agent machine and see if the tests are running fine?Andy Li-MSFT

1 Answers

0
votes

Please try below things to narrow down the issue:

  • Make sure the appropriate test adapter getting deployed along with the test assemblies as Daniel mentioned.

    If not deployed, you would need to copy the appropriate adapter from your local vs machine (\Common7\IDE\CommonExtensions\Microsoft\TestWindow\Extensions) to your test agent box (\Common7\IDE\CommonExtensions\Microsoft\TestWindow\Extensions\Microsoft.VisualStudio.TestPlatform.Extensions)

  • Try run directly from vstest.console.exe on test agent machine with specifing test adapter path using /testadapterpath flag and see if vstest.console works.

    eg:

    C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe "F:\Test****TestAutomation.dll" /TestAdapterPath:F:\Test*\

  • Check if you have included the dependencies with the test dlls.

    eg: manually add reference of Microsoft.VisualStudio.QualityTools.UnitTestFramework in the test project.

If the isse persist, please share the logs for furthre troubleshoot.