Java IE webdriver没有运行我的代码

Java IE webdriver没有运行我的代码,java,eclipse,selenium,webdriver,Java,Eclipse,Selenium,Webdriver,试图通过SeleniumWebDriver在eclipse上运行我的测试用例。它只适用于Firefox驱动程序和Chrome驱动程序,但不适用于IE驱动程序。控制台上显示启动了InternetExplorerDriver服务器,但没有打开窗口。这是我试图运行的代码 包com.example.tests; 导入java.util.regex.Pattern; 导入java.util.concurrent.TimeUnit; 导入org.junit.*; 导入静态org.junit.Assert.*

试图通过SeleniumWebDriver在eclipse上运行我的测试用例。它只适用于Firefox驱动程序和Chrome驱动程序,但不适用于IE驱动程序。控制台上显示启动了InternetExplorerDriver服务器,但没有打开窗口。这是我试图运行的代码

包com.example.tests; 导入java.util.regex.Pattern; 导入java.util.concurrent.TimeUnit; 导入org.junit.*; 导入静态org.junit.Assert.*; 导入静态org.hamcrest.CoreMatchers.*; 导入org.openqa.selenium.*; 导入org.openqa.selenium.chrome.ChromeDriver; 导入org.openqa.selenium.firefox.FirefoxDriver; 导入org.openqa.selenium.ie.InternetExplorerDriver; 导入org.openqa.selenium.support.ui.Select; 公共类MaggiessanityTest{ 私有网络驱动程序; 私有字符串baseUrl; 私有布尔值acceptNextAlert=true; 私有StringBuffer verificationErrors=新StringBuffer; @以前 公共void setUp2引发异常{ 驱动程序=新的InternetExplorerDriver; baseUrl=http://maggies.latestcreativework.com/; driver.manage.timeouts.implicitlyWait30,TimeUnit.SECONDS; } @试验 公共void testUntitled抛出异常{ driver.getbaseUrl+/; driver.findElementBy.linktext玛姬的帮助方式。单击; driver.findElementBy.cssSelectorli.sibling.click; driver.findElementBy.linkTextOUR centers.click; driver.findElementBy.linktext如何提供帮助。单击; driver.findElementBy.linktext关于MAGGIE的。单击; driver.findElementBy.cssSelectorimg[alt=\Maggie's Logo\]。单击; } @之后 公共void撕裂抛出异常{ driver.quit; 字符串verificationErrorString=verificationErrors.toString; if!.equalVerificationErrorString{ failverificationErrorString; } } 私有布尔值isElementPresentBy{ 试一试{ driver.findElementby; 返回true; }捕获非接触性异常{ 返回false; } } 私有布尔isAlertPresent{ 试一试{ driver.switchTo.alert; 返回true; }捕获NoAlertPresentException e{ 返回false; } } 私有字符串closeAlertAndGetItsText{ 试一试{ 警报警报=driver.switchTo.Alert; 字符串alertText=alert.getText; 如果接受Nextalert{ 警惕。接受; }否则{ 警惕。解散; } 返回文本; }最后{ acceptNextAlert=true; } } } 要设置受保护模式设置,请选择Internet选项。。。从“工具”菜单中,单击“安全”选项卡。对于每个区域,选项卡底部都会有一个复选框,标记为启用保护模式

我刚刚尝试过,但它在控制台中抛出了以下错误:

INFO: I/O exception (java.net.SocketException) caught when processing request: Software caused connection abort: recv failed Nov 18, 2013 4:26:01 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: Retrying request Nov 18, 2013 4:26:10 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: I/O exception (java.net.SocketException) caught when processing request: Connection reset Nov 18, 2013 4:26:10 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: Retrying request.
此外,还需要将IE的值设置为正确的值


我已经这样做了,但它仍然没有在IE上运行我的测试用例。它只是打开基本URL,但实际上并不运行测试用例。任何帮助都将不胜感激。

什么版本的IEDriver?什么版本的IE?您在IE中正确设置了保护模式设置了吗?谢谢。我正在使用IEDriverServer.exe进行Selenium测试。我正在运行IE10。IE中的保护模式设置被设置为默认值。默认值意味着什么?作为正确设置IE的一部分,为了准备自动测试,您需要确保每个单独区域的所有受保护模式设置都处于打开/关闭状态。你这样做了吗?我不太清楚怎么做。任何形式的帮助都将是实质性的,我们将不胜感激。谢谢我链接到的页面告诉您如何操作:要设置保护模式设置,请选择Internet选项。。。从“工具”菜单中,单击“安全”选项卡。对于每个区域,选项卡底部将有一个复选框,标记为启用保护模式。。。仅此而已。另外,更直观一点:……还要确保您使用的是32位IEDriver。