From 27bb1a6479b8038027388c7e27c4984342b26fbe Mon Sep 17 00:00:00 2001 From: Jeroen van Warmerdam Date: Fri, 4 Aug 2023 22:41:59 +0200 Subject: [PATCH] Small performance improvement for DriverFactory I noticed in https://github.com/SeleniumHQ/selenium/commit/962a34bfcfd6b5368f9f5df9e5e188b75771f891 that an `if`-statement was used, while probably an `else-if` should have been used, to skip all other conditions when the Chrome driver is used. --- dotnet/test/common/Environment/DriverFactory.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotnet/test/common/Environment/DriverFactory.cs b/dotnet/test/common/Environment/DriverFactory.cs index edee6ae9cc1c2..371df75d4f1f4 100644 --- a/dotnet/test/common/Environment/DriverFactory.cs +++ b/dotnet/test/common/Environment/DriverFactory.cs @@ -46,7 +46,7 @@ public IWebDriver CreateDriverWithOptions(Type driverType, DriverOptions driverO browser = Browser.Chrome; options = GetDriverOptions(driverType, driverOptions); } - if (typeof(EdgeDriver).IsAssignableFrom(driverType)) + else if (typeof(EdgeDriver).IsAssignableFrom(driverType)) { browser = Browser.Edge; options = GetDriverOptions(driverType, driverOptions);