初学Selenium遇上的问题

1.IWebDriver driver = new InternetExplorerDriver();运行时报关于protecte model的错误

解决办法就是用如下代码设置IEDriverOpiton,并将IEDriverServer.exe放在IE的同级目录下 C:\Program Files (x86)\Internet Explorer

static void Main(string[] args)
        {           
            InternetExplorerOptions ieO = new InternetExplorerOptions();
            //set ingnore protected mode as True
            ieO.IntroduceInstabilityByIgnoringProtectedModeSettings = true;
            IWebDriver driver = new InternetExplorerDriver(@"C:\Program Files (x86)\Internet Explorer", ieO);
            driver.Navigate().GoToUrl("http://www.cnblogs.com");
        }

 

posted @ 2015-06-19 11:14  Ellie_Auto  阅读(151)  评论(0)    收藏  举报