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) }));