我正在尝试使用Microsoft表达式编码器SDK录制屏幕视频。 但是它也会记录锁定的Windows屏幕(在超时或Win + L之后)。 如何将CaptureJob绑定到chrome / firefox浏览器并仅捕获浏览器窗口?
using Microsoft.Expression.Encoder.ScreenCapture;
[Binding]
public sealed class CommonWebActions
{
[BeforeScenario]
public static void Initialize(TestContext testContext)
{
Driver = new ChromeDriver();
Driver.Manage().Window.Maximize();
if (VideoRecorder.Status != RecordStatus.Running)
{
TestRecordName = "Test.wmv";
VideoRecorder.OutputScreenCaptureFileName = TestRecordName;
VideoRecorder.Start();
}
}
[AfterScenario]
public static void CleanUp()
{
VideoRecorder.Stop();
if (_testContext.CurrentTestOutcome == UnitTestOutcome.Passed ||
_testContext.CurrentTestOutcome == UnitTestOutcome.Inconclusive)
{
File.Delete(TestRecordName);
}
Driver.Quit();
}
}