这是WebDriver服务器的初始启动页面

Sun*_*ali 5 testng selenium selenium-webdriver

相同的代码在firefox中运行,但它没有在IE9中执行并显示字符串消息"这是WebDriver服务器的初始启动页面".而其他人没有发现任何错误

        public void setUp() throws Exception {

    File file = new File("C:/Users/Sunil.Wali/Desktop/Softwares/IEDriverServer_Win32_2.37.0/IEDriverServer.exe");
    System.setProperty("webdriver.ie.driver", file.getAbsolutePath());

    driver = new InternetExplorerDriver();
    // driver = new FirefoxDriver();

    baseUrl = "https://tssstrpms501.corp.trelleborg.com:12001";
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}
      @Test
public void testLogin() throws Exception {
    driver.get(baseUrl + "/ProcessPortal/login.jsp");
    driver.findElement(By.id("username")).clear();
    driver.findElement(By.id("username")).sendKeys("sunil.wali");
    driver.findElement(By.id("password")).clear();
    driver.findElement(By.id("password")).sendKeys("Trelleborg@123");
    driver.findElement(By.id("log_in")).click();
    driver.findElement(By.id("processPortalUserDropdown")).click();
    driver.findElement(By.id("dijit_MenuItem_56_text")).click();
}

@After
public void tearDown() throws Exception {
    driver.quit();
    String verificationErrorString = verificationErrors.toString();
    if (!"".equals(verificationErrorString)) {
        fail(verificationErrorString);
    }
}
Run Code Online (Sandbox Code Playgroud)

输出: - 启动InternetExplorerDriver服务器(32位)2.37.0.0侦听端口31651

use*_*594 7

确保每个区域的保护模式设置值相同.IE的参考必需配置.

更新: 当您无权访问更改设置时,设置ignoreZoomSettingignoreProtectedModeSettings功能可以提供true帮助.

如果您使用qaf,可以设置如下功能:

driver.name=iexplorerDriver
iexplorer.additional.capabilities={'ignoreProtectedModeSettings':true,'ignoreZoomSetting':true,'nativeEvents':false,'acceptSslCerts':true}
Run Code Online (Sandbox Code Playgroud)


小智 5

  • 在Windows Vista或Windows 7上的IE 7或更高版本上,必须将每个区域的保护模式设置设置为相同的值.只要每个区域的值相同,该值就可以打开或关闭.要设置保护模式设置,请从"工具"菜单中选择"Internet选项...",然后单击"安全"选项卡.对于每个区域,标签底部将显示一个标记为"启用保护模式"的复选框.
  • 此外,必须为IE 10及更高版本禁用"增强保护模式".此选项位于"Internet选项"对话框的"高级"选项卡中.

http://code.google.com/p/selenium/wiki/InternetExplorerDriver#Required_Configuration