【问题标题】:Webdriver script working fine in FF17,But not working in IE7Webdriver 脚本在 FF17 中运行良好,但在 IE7 中无法运行
【发布时间】:2013-01-15 12:53:09
【问题描述】:

下面的 Webdriver 脚本在 FF17 中运行良好,但在 IE-7 中出现错误。我更改了 IE 的保护模式。仍然没有输出。

公共类驱动程序{

DefaultSelenium selenium;
private WebDriver driver;
private StringBuffer verificationErrors = new StringBuffer();
@Before
public void setUp() throws Exception {


    driver = new InternetExplorerDriver();
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);        
}
@Test
public void testTimeWebdriver(){

    try {

        WebElement userName, passWord, submit;
        driver.manage().getCookies();

        driver.get("http://www.google.co.in/");
        //driver.manage().;
                                                                                                                                                                                                                                   driver.findElement(By.id("gbqfq").sendKeys("hello"));



        driver.findElement(By.id("gbqfba")).click();


        WaitForPageToLoad wait = new WaitForPageToLoad();
        wait.setTimeToWait(30000);

        } catch (Exception e) {
        System.out.println(e);
    }

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

IE 获取错误:错误:无法找到名称 == 用户 ID 的元素(警告:服务器未提供任何堆栈跟踪信息);持续时间或超时:30.07 秒 有关此错误的文档,请访问:http://seleniumhq.org/exceptions/no_such_element.html 构建信息:版本:'2.8.0',修订:'14056',时间:'2011-10-06 12:41:26' 系统信息:os.name:'Windows XP',os.arch:'x86',os.version:'5.1',java.version:'1.6.0_38' 驱动信息:driver.version:RemoteWebDriver

【问题讨论】:

    标签: eclipse firefox internet-explorer-7 stack-trace selenium-webdriver


    【解决方案1】:

    WebDriver 不支持IE7。您可以使用IE8 or higher version

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-05-30
    • 2019-12-22
    • 2017-12-07
    相关资源
    最近更新 更多