public IUIDriver CreateUIDriver()
        {
            string    browserName = Configuration.TestExecutionerUIDriverType;
            IUIDriver driver      = browserName switch
            {
                "FIREFOX" => new BrowserDriver(Configuration),
                "IE" => new BrowserDriver(Configuration, BrowserDriver.BrowserDriverEnumeration.IE),
                "CHROME" => new BrowserDriver(Configuration, BrowserDriver.BrowserDriverEnumeration.Chrome),
                "SAUCELABS" => new BrowserDriver(Configuration, BrowserDriver.BrowserDriverEnumeration.SauceLabs),
                "CHROMEREMOTE" => new BrowserDriver(Configuration, BrowserDriver.BrowserDriverEnumeration.ChromeRemote),
                "FIREFOXREMOTE" => new BrowserDriver(Configuration, BrowserDriver.BrowserDriverEnumeration.FirefoxRemote),
                "WINDOWS" => new MobileDriver(Configuration, BrowserDriver.BrowserDriverEnumeration.Windows),
                "ANDROID" => new MobileDriver(Configuration, BrowserDriver.BrowserDriverEnumeration.Android),
                "IOS" => new MobileDriver(Configuration, BrowserDriver.BrowserDriverEnumeration.IOS),
                "WPF" => new WindowsWhite(),
                _ => throw new Exception("Unknown UI driver type in config, expected 'WPF', 'CHROME', 'IE','FIREFOX'"),
            };

            if (driver == null)
            {
                //  throw new Exception("Unable to create UI driver, configuration setting should be WPF or WEB, actual value: " + uiDriverType);
            }

            return(driver);
        }
 public IScreenCapture CreateScreenCapturer(IUIDriver driver, string rootPathOrURL = null)
 {
     return(new HeadlessScreenCapture(rootPathOrURL.isNull() ? Configuration.ScreenCaptureLocalPath : rootPathOrURL, driver));
     //return new LocalScreenCapture(rootPathOrURL.isNull() ? configuration.ScreenCaptureLocalPath : rootPathOrURL);
 }
예제 #3
0
 public HeadlessScreenCapture(string rootPath, IUIDriver driver)
 {
     Driver = driver;
     Photo  = new ScreenPhotographer(rootPath);
 }