Tests wont run from build output folder when using runsettings file

Wilnic Marc 1 Reputation point
2020-08-18T15:49:28.673+00:00

VS2017 Version 15.9.24

I'm having issues with running my test cases. When i run my test using my run settings file. It keeps wanting to run the test from the test results folder instead of the build output folder. I don't know why this is happening or if my runsettings file is wrong.

I'm using msdn doc ms245570(v=vs.110)which states to add a runsettings to solution then add the have this settings set to false .

<DeploymentEnabled>false</DeploymentEnabled>

I'm running selenium and It looking for driverservice and its failing because the file its looking for is in the test results folder

Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
327 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 27,106 Reputation points Microsoft Vendor
    2020-08-20T10:07:06.773+00:00

    Hello Wilnic,

    I checked and tested the .runsettings file which you provided on my side and the tests worked well. I suggest you try following steps to troubleshoot.

    1. rename(or delete) the hidden .vs, bin and obj folders in your solution or project folder. After that rename(or delete) every subfolders named ComponentModelCache under this directory C:\Users\[user name]\AppData\Local\Microsoft\VisualStudio\15.0_XXXXX. Build and run tests again.
    2. Close all Visual Studio instances and open Developer Command Prompt for VS 2017 > type devenv /ResetSettings > press Enter to reset Visual Studio default settings.
    3. Try to create a new solution(project) and add the necessary codes, files and resources to the new solution(project) and check if it works this time. Or you can try to create a new .runsettings file and copy the content from the old .runsettings file to new one, then test again.

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Update1

    I suggest you try to just use runsettings file and set this parameter <DeploymentEnabled>false</DeploymentEnabled> to <DeploymentEnabled>true</DeploymentEnabled> to check if tests run.

    Besides, did you enable deployment and add related files or directory when using testsettings file?
    19069-test4.png

    Please also kindly try to directly use DeploymentItemAttribute Class, for example [DeploymentItem("file1.xml")] [DeploymentItem("file2.xml", "DataFiles")] [DeploymentItem("bin\Debug")]

    Best Regards,
    Tianyu

    1: https://learn.microsoft.com/en-us/visualstudio/ide/reference/resetsettings-devenv-exe?view=vs-2017 3: https://learn.microsoft.com/en-us/dotnet/api/microsoft.visualstudio.testtools.unittesting.deploymentitemattribute?view=mstest-net-1.2.0#examples