捕获测试用例的视频

Capture Video of Test case

我 运行 UI 使用 Run Functional Tests 进行测试。 在此之前,测试代理使用 Visual Studio Test Agent Deployment.

部署

我想配置测试代理来记录测试并将视频附加到测试结果。

我将 testsettings 设置为按照 here in msdn and installed the Expression Encoder described here 所述录制视频。

我还启用了SystemInformation.xml,它将被生成。所以testsettings文件没有被忽略。

testsettings 文件:

<?xml version="1.0" encoding="UTF-8"?>
<TestSettings name="TFS Test Settings" id="dfa051f4-3d54-4d50-95ab-f414f1aea19e" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
  <Description>These are default test settings for a local test run.</Description>
  <Deployment enabled="false" />
  <Scripts setupScript="\FileServer\shares\testdata\copySeeFxIni.bat" />
  <Execution>
    <Timeouts runTimeout="23400000" testTimeout="600000" />
    <TestTypeSpecific>
      <UnitTestRunConfig testTypeId="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b">
        <AssemblyResolution>
          <TestDirectory useLoadContext="true" />
        </AssemblyResolution>
      </UnitTestRunConfig>
    </TestTypeSpecific>
    <AgentRule name="LocalMachineDefaultRole">
      <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">
        </DataCollector>
        <DataCollector uri="datacollector://microsoft/SystemInfo/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TestTools.DataCollection.SystemInfo.SystemInfoDataCollector, Microsoft.VisualStudio.TestTools.DataCollection.SystemInfo, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="System Information">
        </DataCollector>
      </DataCollectors>
    </AgentRule>
  </Execution>
  <Properties>
    <Property name="TestSettingsUIType" value="UnitTest" />
  </Properties>
</TestSettings>

Build Log


不确定是否与此有关。我在 TestAgent2017\Common7\IDE\PrivateAssemblies\DataCollectors\ 下找到了 VideoRecorder Datacollector。还有就是VSTestVideoRecorder.exe。从名字上看,它是用来录制视频的。尝试手动 运行 它时,我在控制台上遇到异常。

Unhandeld Exception: System.DllNotFoundException: Unable to load DLL 
'Microsoft.VisualStudio.QualityTools.VideoRecorderEngine.dll': 
The specified module could not be found (Exception from HRESULT: 0x8007007E)

但是 Microsoft.VisualStudio.QualityTools.VideoRecorderEngine.dll 在同一目录中。而且我不明白为什么抛出这个异常。

我在任何日志中都没有看到这个异常(我找到了)。

问题是我安装了错误的 Windows 版本。我使用的是缺少媒体功能的 N 版。安装缺少的组件后,视频录制工作正常。