From 5a06b8ac03a78562772249f1c194b1b107e9025f Mon Sep 17 00:00:00 2001 From: "dmitry.bogatko" Date: Wed, 18 Sep 2024 20:31:09 +0300 Subject: [PATCH] [#262] refactoring of BrowserFactory.cs --- .../src/Aquality.Selenium/Browsers/BrowserFactory.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Aquality.Selenium/src/Aquality.Selenium/Browsers/BrowserFactory.cs b/Aquality.Selenium/src/Aquality.Selenium/Browsers/BrowserFactory.cs index 9d51001..518e6f5 100644 --- a/Aquality.Selenium/src/Aquality.Selenium/Browsers/BrowserFactory.cs +++ b/Aquality.Selenium/src/Aquality.Selenium/Browsers/BrowserFactory.cs @@ -33,9 +33,8 @@ public virtual Browser Browser { var driverCtx = ActionRetrier.DoWithRetry(() => DriverContext, new[] { typeof(WebDriverException), typeof(InvalidOperationException) }); - - Browser browser; - browser = driverCtx != null + + var browser = driverCtx != null ? new Browser(driverCtx.Driver, driverCtx.DriverService) : new Browser(ActionRetrier.DoWithRetry(() => Driver, new[] { typeof(WebDriverException), typeof(InvalidOperationException) }));