public void ScreenRecordWithOptionsTest() { _driver.StartRecordingScreen( AndroidStartScreenRecordingOptions.GetAndroidStartScreenRecordingOptions() .WithTimeLimit(TimeSpan.FromSeconds(10)) .WithBitRate(500000) .WithVideoSize("720x1280")); Thread.Sleep(1000); var result = _driver.StopRecordingScreen(); Assert.IsNotEmpty(result); }
/// <summary> /// 开始录制屏幕 /// </summary> /// <param name="logOutput"> 是否打印执行日志 </param> public void StartRecordingScreen(bool logOutput = true) { try { AndroidDriver.StartRecordingScreen(AndroidStartScreenRecordingOptions .GetAndroidStartScreenRecordingOptions() .WithTimeLimit(TimeSpan.FromSeconds(10)) .WithBitRate(500000) .WithVideoSize("720x1280")); if (logOutput) { LogServe.Info($"设备开始录制屏幕"); } } catch (Exception Err) { LogServe.Error($"Error:: 设备录制屏幕异常: { Err.Message }"); throw; } }