Пример #1
0
        public RuntimeSettings()
        {
            AppBaseUrl        = Config.GetSettingValue("ApplicationBaseUrl", null);
            SeleniumBrowser   = getBrowserTypeFromConfig();
            BrowserVersion    = Config.GetSettingValue("BrowserVersion", null);
            BrowserLanguage   = Config.GetSettingValue("BrowserLanguage", "en-US");
            BrowserResolution = Config.GetSettingValue("BrowserResolution", "maximized");

            if (BrowserResolution.Contains("maximized"))
            {
                WindowMaximized = true;
            }
            else
            {
                WindowMaximized = false;
                WindowWidth     = ParseWindowWidth();
                WindowHeight    = ParseWindowHeight();
            }

            SeleniumGridUrl      = Config.GetSettingValue("SeleniumGridUrl", "http://*****:*****@"Initializing Runtime settings:
                        AppBaseUrl: {AppBaseUrl}                    
                        SeleniumBrowser: {SeleniumBrowser}
                        ScreenshotOnFailure: {ScreenshotOnFailure}
                        SeleniumDebugMode: {SeleniumDebugMode}");
        }
Пример #2
0
        private int ParseWindowHeight()
        {
            int height;

            string[] dimensions = BrowserResolution.Split('x');

            try
            {
                height = int.Parse(dimensions[1]);
            }
            catch (FormatException e)
            {
                throw new InvalidWindowSizeException($"Invalid window height specified of resolution {BrowserResolution}", e);
            }

            return(height);
        }
Пример #3
0
        private int ParseWindowWidth()
        {
            int width;

            string[] dimensions = BrowserResolution.Split('x');

            try
            {
                width = int.Parse(dimensions[0]);
            }
            catch (FormatException e)
            {
                throw new InvalidWindowSizeException($"Invalid window width specified of resolution {BrowserResolution}", e);
            }

            return(width);
        }