visual-studiovideo-capturerunsettings

How to configure directory for video recorder datacollector in runsettings file? VS 2019


Previously we used test settings , but it was deprecated and we want to upgrade VS version from 2017 to 2019 at least, we also have own logger as html report for all actions from test, I've configured run settings file with video recorder data collector but it works like this: If I have video recorder in run settings it creates video on remote machine, but we don't have html file If I don't use video recorder in run settings then it creates and attached html file because it creates video in a separate new folder somehow.

Question - How to configure writing of video to the same folder to have html and video as test results attachments?

I also configured results directory, but it doesn't help.

Example of runsettings file:

<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
  <!-- Configurations that affect the Test Framework -->
  <RunConfiguration>
    <!-- Path relative to solution directory -->
    <ResultsDirectory>.\TestResults</ResultsDirectory>

    <!-- [x86] | x64  
 - You can also change it from menu Test, Test Settings, Default Processor Architecture -->
    <TargetPlatform>x86</TargetPlatform>
    <BatchSize>1000</BatchSize>
    <TestSessionTimeout>72000000</TestSessionTimeout>
  </RunConfiguration>

  <LegacySettings>
    <Execution>
      <TestTypeSpecific>
        <UnitTestRunConfig testTypeId="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b">
          <AssemblyResolution>
            <TestDirectory useLoadContext="true" />
          </AssemblyResolution>
        </UnitTestRunConfig>
      </TestTypeSpecific>
      <Timeouts testTimeout="2700000" />
    </Execution>
  </LegacySettings>

  <!-- Configurations for data collectors -->
  <DataCollectionRunSettings>
    <DataCollectors>
      <DataCollector uri="datacollector://microsoft/VideoRecorder/1.0"
        assemblyQualifiedName="Microsoft.VisualStudio.TestTools.DataCollection.VideoRecorder.VideoRecorderDataCollector, Microsoft.VisualStudio.TestTools.DataCollection.VideoRecorder, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
        friendlyName="Screen and Voice Recorder">
        <Configuration>
          <MediaRecorder sendRecordedMediaForPassedTestCase="false" xmlns="" />
          <ScreenCaptureVideo bitRate="512" frameRate="2" quality="20" />
        </Configuration>
      </DataCollector>
    </DataCollectors>
  </DataCollectionRunSettings>

  <!-- MSTest adapter -->
  <MSTest>
    <MapInconclusiveToFailed>False</MapInconclusiveToFailed>
    <CaptureTraceOutput>False</CaptureTraceOutput>
    <DeleteDeploymentDirectoryAfterTestRunIsComplete>False</DeleteDeploymentDirectoryAfterTestRunIsComplete>
    <DeploymentEnabled>False</DeploymentEnabled>
  </MSTest>
</RunSettings>

I tried to change directory itself, to run it without configured directory due to separate settings in azure for release pipeline itself, but it didn't help.


Solution

  • It was related to old adapter version ~ 1.3 , need to add ForcedLegacyMode equals to true inside MSTest adapter settings and it will work.