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

标签 selenium selenium-webdriver testng

相同的代码在 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);
    }
}

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

最佳答案

确保每个区域的保护模式设置值相同。引用 Required Configuration for IE .

更新 : 设置 ignoreZoomSettingignoreProtectedModeSettings功能到 true当您无权更改设置时会有所帮助。

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

driver.name=iexplorerDriver
iexplorer.additional.capabilities={'ignoreProtectedModeSettings':true,'ignoreZoomSetting':true,'nativeEvents':false,'acceptSslCerts':true}

关于selenium - 这是 WebDriver 服务器的初始启动页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19979283/

相关文章:

python - 无限加载从新闻网站上抓取头条新闻

java - 如何等待按钮内的加载程序完成加载?

selenium - 配置 ExtentReports 以提供准确的测试状态和失败截图

java - 如何运行指向 jar 的 TestNG 测试

java - 如何断言 TestNG java 没有抛出异常

python - selenium python 检查隐藏错误

javascript - 使用 selenium,如何检测 Internet Explorer 浏览器插件?

javascript - 使用 Selenium 模拟将文件拖到上传元素上

java - 如何在 selenium 中处理 SafariDriver 的警报?

java - 单击与其他元素具有相同类名的元素