/// <summary> /// Helper Method which scans all possible active drivers. /// </summary> private void GetActiveDriverReporter() { List <object> drivers = new List <object> { BaseDriver.GetInstance(), GenericDriver.GetInstance(), AndroidDriver <AppiumWebElement> .GetInstance(), IOSDriver <AppiumWebElement> .GetInstance(), }; foreach (var driver in drivers) { if (driver != null) { if (driver is IWebDriver currentDriver) { this.Reporter = currentDriver.Report(); } else { this.Reporter = ((GenericDriver)driver).Report(); } return; } } // If driver is null, there is no active driver session throw new SdkException("No active driver instance found for reporting"); }