1

我需要在不使用 IDEServer 的情况下使用 IE webdriver。如果我不使用“InternetExplorerDriver”和路径,则会出现此错误。

IEDriverServer.exe 不存在-文件 c:\users\administrator\documents\visual studio 2010\projects\TestProject1\TestProject1\bin\Debug\IEDriverServer.exe 不存在。该驱动程序可以在http://code.google.com/p/selenium/downloads/list下载。

有没有办法在不运行 IDEServer 的情况下连接到 IEDriver 并且还需要覆盖安全错误“此网站的安全证书有问题。”
有没有其他选择

        IWebDriver driver;
        var options = new InternetExplorerOptions();
        //options.IntroduceInstabilityByIgnoringProtectedModeSettings = true;
        driver = new InternetExplorerDriver("D://Software", options); 

        driver.Navigate().GoToUrl("www.google.com");//EXAMPLE

        driver.Navigate().GoToUrl("javascript:document.getElementById('overridelink').click()");
        IWebElement uname = driver.FindElement(By.Id("ctl00_uxContentPlaceHolder_uxUsername"));
        uname.SendKeys("chris");
        IWebElement pwd = driver.FindElement(By.Id("ctl00_uxContentPlaceHolder_uxPassword"));
        pwd.SendKeys("chris1*");
4

1 回答 1

3

This is actually two different questions. To answer the one indicated in the summary line of this post, no, you now must have the IEDriverServer.exe in order to use WebDriver with IE in most of the official language bindings (.NET, Python, and Ruby). As of this writing, the Java language bindings provide a fallback mechanism using a .dll version of the IEDriverServer, but this is being phased out within the next couple of releases, and at that time the requirement for the IEDriverServer.exe will extend to Java as well.

于 2012-07-03T13:09:13.453 回答