diff --git a/UI.AutomationTests/CommonUiTest.cs b/UI.AutomationTests/CommonUiTest.cs index df07994f..5af5992a 100644 --- a/UI.AutomationTests/CommonUiTest.cs +++ b/UI.AutomationTests/CommonUiTest.cs @@ -90,7 +90,7 @@ protected IVhDriver CreateDriver(string username, string videoFileName = null) } else { - driver = new RemoteChromeVhDriver(username: username); + driver = new RemoteChromeVhDriver(username: username, videoFileName:videoFileName); } driver.GetDriver().StoreUsername(username); diff --git a/UI.AutomationTests/Drivers/LocalChromeVhDriver.cs b/UI.AutomationTests/Drivers/LocalChromeVhDriver.cs index 6acbb129..833a5486 100644 --- a/UI.AutomationTests/Drivers/LocalChromeVhDriver.cs +++ b/UI.AutomationTests/Drivers/LocalChromeVhDriver.cs @@ -17,6 +17,7 @@ public LocalChromeVhDriver(string videoFileName = null) chromeOptions.AddArgument("--no-sandbox"); chromeOptions.AddArgument("--mute-audio"); chromeOptions.AddArgument("--use-fake-device-for-media-stream"); + chromeOptions.AddArgument("--use-fake-ui-for-media-stream"); if (videoFileName != null) { @@ -26,8 +27,6 @@ public LocalChromeVhDriver(string videoFileName = null) throw new FileNotFoundException($"Video file not found: {videoFilePath}"); } chromeOptions.AddArgument($"--use-file-for-fake-video-capture={videoFilePath}"); - } else { - chromeOptions.AddArgument("--use-fake-ui-for-media-stream"); } var envConfigSettings = ConfigRootBuilder.EnvConfigInstance(); diff --git a/UI.AutomationTests/Drivers/RemoteChromeVhDriver.cs b/UI.AutomationTests/Drivers/RemoteChromeVhDriver.cs index d8905038..52ca26db 100644 --- a/UI.AutomationTests/Drivers/RemoteChromeVhDriver.cs +++ b/UI.AutomationTests/Drivers/RemoteChromeVhDriver.cs @@ -9,7 +9,7 @@ public class RemoteChromeVhDriver : IVhDriver private RemoteWebDriver _driver; public RemoteChromeVhDriver(string platform = "Windows 11", string browserVersion = "latest", - string username = null) + string username = null, string videoFileName = null) { var envConfigSettings = ConfigRootBuilder.EnvConfigInstance(); var chromeOptions = new ChromeOptions @@ -20,8 +20,7 @@ public RemoteChromeVhDriver(string platform = "Windows 11", string browserVersio chromeOptions.AddArguments("start-maximized"); chromeOptions.AddArgument("no-sandbox"); - chromeOptions.AddArguments("--use-fake-ui-for-media-stream"); - chromeOptions.AddArguments("--use-fake-device-for-media-stream"); + chromeOptions.AddArgument("--use-fake-ui-for-media-stream"); // this is the name for a build in SauceLabs var buildName = Environment.GetEnvironmentVariable("TF_BUILD") == null