1
votes

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?

2
Are you actually building an assembly that matches that pattern? What is your build output folder versus the value of $(System.DefaultWorkingDirectory)?Daniel Mann
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.dllKonzy262
Should be the same folder during build asuming you have used the same buildplatform and configuration in your build as you used locallyD.J.
Can you share the detail build log on the OneDrive? (Open a build and click Download all logs as zip)starian chen-MSFT
Can you post the detail log here?starian chen-MSFT

2 Answers

2
votes

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

-2
votes

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.