首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >硒与非工作IEDriverServer

硒与非工作IEDriverServer
EN

Stack Overflow用户
提问于 2014-02-23 22:02:46
回答 1查看 1.7K关注 0票数 0

当我尝试页面的简单导航时,IEDriverServer会抛出一个OpenQA.Selenium.WebDriverException。这对于Firefox来说是可行的。

这是“意外错误”,如果我进一步阅读,它似乎是404页找不到。

我已经禁用了所有区域的保护模式,并在InternetExplorerOptions对象上创建了InternetExplorerOptions

在这种情况下,如何使IE工作呢?

编辑这里是堆栈跟踪:

(在OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)在OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute,Dictionary`2‘2参数(在OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)在OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor,ICapabilities desiredCapabilities(在OpenQA.Selenium.IE.InternetExplorerDriver..ctor(InternetExplorerDriverService服务,InternetExplorerOptions options,TimeSpan commandTimeout) 在OpenQA.Selenium.IE.InternetExplorerDriver..ctor(InternetExplorerDriverService服务,InternetExplorerOptions选项)在CUWebinars.Selenium.Core.Ie.IeTestDriver..ctor() in e:\TTS\BankWebinars\CUWebinars.Selenium.Core\Ie\IeTestDriver.cs:line 21 at CUWebinars.WebUi.Tests.Ie.IeBaseTest.Setup() in e:\TTS\BankWebinars\CUWebinars.WebUi.Tests\Ie\IeBaseTest.cs:line 13

编辑2下面是IeTestDriver (自定义类)的构造函数

代码语言:javascript
复制
const string ieTestDriverLocation = @"E:\";
var internetExplorerDriverService = InternetExplorerDriverService.CreateDefaultService(ieTestDriverLocation);
var internetExplorerOptions = new InternetExplorerOptions();

internetExplorerDriverService.Port = 333; // this is the port for the driver, not the webpage            
port = "5556"; // in base class

webDriver = new InternetExplorerDriver(internetExplorerDriverService, internetExplorerOptions); // crashes here
webDriver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(10));
webDriver.Manage().Timeouts().SetScriptTimeout(TimeSpan.FromSeconds(10));
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-02-24 06:47:17

333指定的端口InternetExplorerDriverService位于众所周知的端口号范围内:

在大多数系统上,众所周知的端口号只能由系统(根)进程或特权用户运行的程序使用。

允许驱动程序服务通过不显式指定端口或提供可用端口来选择自己的端口。

双击IEDriverServer.exe将为您提供一条Listening on port <number>消息,以查看它在可用时自动获取的内容。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21975241

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档