1

I'm attempting to run some selenium tests in my solution that are in a project called SA.SEPA.Web.UI.Selenium as part of a build definition in VSTS, but it is failing to run the Visual Studio Test task with the error...

No test assemblies found matching the pattern: **\*Selenium*.dll.

Search folder is set to - $(System.DefaultWorkingDirectory)

Preceding tasks are a nuget restore and build solution

enter image description here

Can anyone help?

Konzy262
  • 2,747
  • 6
  • 42
  • 71
  • 1
    Are you actually building an assembly that matches that pattern? What is your build output folder versus the value of `$(System.DefaultWorkingDirectory)`? – Daniel Mann Nov 14 '17 at 14:42
  • Apologies, I'm completely new to this so don't understand the question. How do I find out what my build output folder is on VSTS? Locally I think the unit test file I am after is located at ..\SA.SEPA.Web.UI.Selenium\bin\debug\SA.SEPA.Web.UI.Selenium.dll – Konzy262 Nov 14 '17 at 14:56
  • Should be the same folder during build asuming you have used the same buildplatform and configuration in your build as you used locally – D.J. Nov 14 '17 at 14:59
  • Can you share the detail build log on the OneDrive? (Open a build and click Download all logs as zip) – starian chen-MSFT Nov 15 '17 at 07:54
  • Can you post the detail log here? – starian chen-MSFT Nov 17 '17 at 01:24

2 Answers2

2

You are specifying $(System.DefaultWorkingDirectory) as the search folder. By default (unless overridden), this points to the Source folder on the Agent. If you are instructing MSBuild (using the OutDir parameter) to output your assemblies in a specific location then you should use that location.

Edit: If this is an On-premises Agent, it should also be running in interactive mode (not service) if you want to execute any UI tests

Kostas Mat
  • 36
  • 4
  • Hi Kostas. Where is this 'Source folder on the Agent' and how would I be able to check the contents? I don't believe I have instructed MSBuild to do anything. I do wish to run UI tests but they include a remote link which I think means they may not need to run interactively. Thanks – Konzy262 Nov 14 '17 at 17:02
  • All the directories (source, binaries, artifacts) are relevant to the directory where the Agent is installed. This is done when you configure the agent for the first time. If your Agent is configured to work under C:\Agent\_work then the source folder for your first build definition will be under C:\Agent\_work\1\s – Kostas Mat Nov 14 '17 at 20:18
-2

I ran into this same error but it was a different cause, so I'm adding my solution here.

I was getting the "no test assemblies found" error when trying to run Selenium tests with VSTS as part of a build.

My problem turned out to be that the test assemblies were not checked into change control (git, through VS2017), and therefore were not part of the build. The folders that contain the test assemblies were ignored during my original check-in by default. Once I added those folders to my repository, the build could find the tests and run them.

  • 1
    what do you mean with the `test assemblies`? you shouldn't need to commit the binaries to git... – knocte Sep 20 '18 at 12:03
  • Maybe a configuration error on my part then. I actually haven't been in this project for awhile, but if I recall correctly, MS Build was complaining that it needed the test assemblies. Once I added those folders to my remote repository it started working. – John McConda Sep 21 '18 at 16:36
  • 1
    @knocte is right. You need those files to be built by the build server, not checked in to it. Otherwise you'll have to manually check in that dll each time, instead of the source files which should be compiled every time a change is made and committed. – Chucky Mar 07 '19 at 15:27