Ejemplo n.º 1
0
        public static void Initialize()
        {
            TheEnvironment = GetEnvironment(EnvironmentType.Qa01);
            TheLoginData   = TheEnvironment;

            InternetExplorerHelper.SetZoom100();
            string appPath = AppDomain.CurrentDomain.BaseDirectory.Trim();

            if (appPath == "")
            {
                appPath = "https://uat.cmtanalytics.com";
            }
            //Cmt.Online
            //string iePath = appPath.Substring(startIndex: 0, length: appPath.IndexOf(value: "TestResults"))+ @"packages\Selenium.WebDriver.IEDriver.2.53.1.1\driver";
            string iePath = "C:\\CMT\\Main\\" + @"packages\Selenium.WebDriver.IEDriver.2.53.1.1\driver";
            var    opts   = new InternetExplorerOptions
            {
                PageLoadStrategy   = InternetExplorerPageLoadStrategy.Eager,
                IgnoreZoomLevel    = true,
                EnableNativeEvents = false,
                EnsureCleanSession = true,
                RequireWindowFocus = false,
                InitialBrowserUrl  = TheLoginData.WebSite + "/Login.aspx"
            };

            Instance = new InternetExplorerDriver(internetExplorerDriverServerDirectory: iePath, options: opts);
            Instance.Manage().Timeouts().ImplicitlyWait(new TimeSpan(hours: 0, minutes: 0, seconds: 15));
            Instance.FindElement(By.TagName("html")).SendKeys(Keys.Control + "0");

            //Instance = new FirefoxDriver();
        }
Ejemplo n.º 2
0
        public static IWebDriver Initialize(string url)
        {
            InternetExplorerHelper.SetZoom100();

            string appPath = AppDomain.CurrentDomain.BaseDirectory;
            string iePath  = appPath.Substring(startIndex: 0, length: appPath.IndexOf(value: "Cmt.Online")) + @"packages\Selenium.WebDriver.IEDriver.2.53.1.1\driver";

            var opts = new InternetExplorerOptions
            {
                PageLoadStrategy   = InternetExplorerPageLoadStrategy.Eager,
                IgnoreZoomLevel    = true,
                EnableNativeEvents = false,
                EnsureCleanSession = true,
                RequireWindowFocus = false,
                InitialBrowserUrl  = url
            };

            Instance = new InternetExplorerDriver(internetExplorerDriverServerDirectory: iePath, options: opts);
            Instance.Manage().Timeouts().ImplicitlyWait(new TimeSpan(hours: 0, minutes: 0, seconds: 15));
            return(Instance);
        }