Exemple #1
0
        /// <summary>
        /// Get a new IE driver
        /// </summary>
        /// <param name="commandTimeout">Browser command timeout</param>
        /// <param name="internetExplorerOptions">Browser options</param>
        /// <param name="size">Browser size in the following format: MAXIMIZE, DEFAULT, or #x# (such as 1920x1080)</param>
        /// <returns>A new IE driver</returns>
        public static IWebDriver GetIEDriver(TimeSpan commandTimeout, InternetExplorerOptions internetExplorerOptions, string size = "MAXIMIZE")
        {
            return(CreateDriver(() =>
            {
                LazyInitializer.EnsureInitialized(ref IEDriverPath, () => new DriverManager().SetUpDriver(new InternetExplorerConfig(), SeleniumConfig.GetIEVersion()));

                var driver = new InternetExplorerDriver(Path.GetDirectoryName(IEDriverPath), internetExplorerOptions, commandTimeout);
                SetBrowserSize(driver, size);

                return driver;
            }, SeleniumConfig.GetRetryRefused()));
        }